Closed
Description
Sample code:
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Listener(
behavior: HitTestBehavior.opaque,
onPointerDown: (e) {
print('RAW: ${RawKeyboard.instance.keysPressed}');
print('HW: ${HardwareKeyboard.instance.logicalKeysPressed}');
},
child: Container(),
),
),
);
}
}
To reproduce, focus the flutter window, hold shift key and click on another window to unfocus flutter window. After that, depress the shift key and click anywhere in the Flutter window.
Expected output (keys currently pressed):
flutter: RAW: {}
flutter: HW: {}
Actual output (raw keyboard has shift key stuck):
flutter: RAW: {LogicalKeyboardKey#df100(keyId: "0x200000102", keyLabel: "Shift Left", debugName: "Shift Left")}
flutter: HW: {}
HW keyboard does not have the shift key pressed anymore, but when you shift+click now, the HW keyboard will not register the shift until keyboard event.
The problem here is, as far as I can tell, that only FlutterKeyboardManager
only synchronizes modifiers for FlutterEmbedderKeyResponder
, not doing anything for FlutterChannelKeyResponder
.
Metadata
Metadata
Assignees
Labels
Running on desktopEntering text in a text field or keyboard related problemsflutter/engine repository. See also e: labels.Found to occur in 3.13Found to occur in 3.15The issue has been confirmed reproducible and is ready to work onBuilding on or for macOS specificallyIssue is closed as already fixed in a newer versionOwned by the macOS platform team