-
-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RawKeyEvent returns incorrect logicalKey #306
Comments
The most interesting part, that I get a correct It works as expected on Flutter (Channel stable, 3.3.10, on Ubuntu 20.04.2 LTS 5.15.0-56-generic, locale en_US.UTF-8) |
Hey, AFAICT this is correct behaviour:
Use If you're wondering why But then, the logical keyboard key of that same key event will be |
Wait so it's the |
Thanks. Gonna check it out on the weekend.
no, I'm just wondering why the same code works differently on So I made a hot fix by changing this: final String v = event.logicalKey.keyLabel.toString(); to this: final RawKeyEventDataLinux data = event.data as RawKeyEventDataLinux;
final String v = LogicalKeyboardKey(data.keyCode).keyLabel.toString(); |
seems like this is a known issue: flutter/flutter#65668 EDIT: Also Maybe the solution is to make use of the new |
When #308 is fixed, you should be able to use a |
Hello, I've got so strange behavior with
RawKeyboardListener
.keyCode
is correct, butevent.logicalKey.keyLabel
returns8
instead of*
and the same for other key events with modifiers.I've double-checked my OS and everything is ok in terminal, I've also checked
libinput debug-events
and it works as expected.RawKeyEvent data for both keys:
Widget code
* (shift+8)
RawKeyEventDataLinux#ed7a0(toolkit: GTK, unicodeScalarValues: 56, scanCode: 17, keyCode: 42, modifiers: 1, isDown: true)
8:
RawKeyEventDataLinux#85610(toolkit: GTK, unicodeScalarValues: 56, scanCode: 17, keyCode: 56, modifiers: 0, isDown: true)
raspberry pi 3b+
Flutter 3.0.2
flutter-pi e919e11
flutter-engine-binaries-for-arm 9eaa027
The text was updated successfully, but these errors were encountered: