-
Notifications
You must be signed in to change notification settings - Fork 132
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
Pressing "2" key on keyboard produces error bug #261
Comments
Actually I found out that with a Tenkeyless keyboard, pressing "2" produces above error. However, pressing "m" key on both tenkeyless and standard sized keyboard produces error. |
I experienced the same bug, and found a solution. The following patch for flutter-embedded-linux fixes this: diff --git a/src/flutter/shell/platform/linux_embedded/plugins/key_event_plugin.cc b/src/flutter/shell/platform/linux_embedded/plugins/key_event_plugin.cc
index 923054b..b1fcafb 100644
--- a/src/flutter/shell/platform/linux_embedded/plugins/key_event_plugin.cc
+++ b/src/flutter/shell/platform/linux_embedded/plugins/key_event_plugin.cc
@@ -132,7 +132,6 @@ void KeyeventPlugin::SendKeyEvent(uint32_t keycode,
event.AddMember(kKeyCodeKey, keycode, allocator);
event.AddMember(kKeyMapKey, kLinuxKeyMap, allocator);
event.AddMember(kToolkitKey, kGLFWKey, allocator);
- event.AddMember(kScanCodeKey, keycode, allocator);
event.AddMember(kModifiersKey, modifiers, allocator);
if (unicode != 0) {
event.AddMember(kUnicodeScalarValues, unicode, allocator); The reason this works is that , in Flutter, here, the scan code is used to retrieve a physical key code, and then here the scan code of the "2" key leads to the @HidenoriMatsubayashi you're not accepting pull requests, but please feel free to just take the above patch or a similar fix to address this issue, if you like. Thank you. |
The patch may fix the issue, but for regular key input cases, does it work?
You can create and send a PR now :). (we can accept your PRs) |
Flutter version: 2.10.3
flutter-elinux create keyboard_test cd keyboard_test flutter-elinux run
Press "2" key (not numpad) on keyboard.
No error is produced when running the same project with flutter linux.
The text was updated successfully, but these errors were encountered: