-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsc: regressionIt was better in the past than it is nowIt was better in the past than it is nowfound in release: 2.5Found to occur in 2.5Found to occur in 2.5found in release: 2.6Found to occur in 2.6Found to occur in 2.6frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-macosOwned by the macOS platform teamOwned by the macOS platform teamwaiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
Description
Shift Keyboard Key not detected
A while ago, almost all keyboard shortcuts in our app stopped working. Now, I investigated it and realized that shift is completely broken.
That is, any shortcuts that use shift do not work. That applies both to SingleActivator as well as LogicalKeySet; LogicalKeyboardKey.shift simply seems to be broken. This happens to our users on Chrome using any device (Windows laptop, Macbook, w/e).
SingleActivator(
LogicalKeyboardKey.keyA,
)Is detected but:
SingleActivator(
LogicalKeyboardKey.keyA,
shift: true,
)is not detected. All the other modifiers still work.
Steps to Reproduce
- Run
flutter create bug --platforms=web. - Update
main.dartas follows:
Click to expand code snippet
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Shift is broken',
shortcuts: const {
SingleActivator(
LogicalKeyboardKey.keyA,
control: true,
): PrintIntent(false),
SingleActivator(
LogicalKeyboardKey.keyA,
shift: true,
): PrintIntent(true),
},
actions: {
PrintIntent: CallbackAction<PrintIntent>(onInvoke: (intent) {
if (intent.shift) {
// This is never called.
print('Shift is working');
return;
}
print('Control is working.');
}),
},
builder: (context, child) {
return const Focus(
autofocus: true,
child: Placeholder(),
);
},
);
}
}
class PrintIntent extends Intent {
const PrintIntent(this.shift);
final bool shift;
}- Run
cd bugandflutter run -d chrome. - Focus the window.
- Press CTRL + A.
- Press SHIFT + A.
Expected results: Control is working. and then Shift is working.
Actual results: Control is working. only.
Logs
Performing hot restart...
Waiting for connection from debug service on Chrome...
Restarted application in 374ms.
Control is working.
Control is working.
Control is working.
[✓] Flutter (Channel dev, 2.6.0-5.1.pre, on Microsoft Windows [Version 10.0.19042.1165], locale en-150)
• Flutter version 2.6.0-5.1.pre
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision f2903d3da5 (7 days ago), 2021-09-08 12:44:29 -0700
• Engine revision 0bd9be379a
• Dart version 2.15.0 (build 2.15.0-82.0.dev)
[✓] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[✓] Connected device (3 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 93.0.4577.82
hillelcoren, bernaferrari, canastro, otopba, fabiancrx and 1 more
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsc: regressionIt was better in the past than it is nowIt was better in the past than it is nowfound in release: 2.5Found to occur in 2.5Found to occur in 2.5found in release: 2.6Found to occur in 2.6Found to occur in 2.6frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-macosOwned by the macOS platform teamOwned by the macOS platform teamwaiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
Type
Projects
Status
Done