linux: Send scancode instead of keycodes
X11 sends Linux keycodes that only match scancodes on a limited part of the keys. For example for extended scancodes, the values don't match.
showkey command can display a mapping:
-
https://linux.die.net/man/1/showkey
-
https://github.com/legionus/kbd/blob/master/src/showkey.c
-
[ ] Tested on all platforms changed
-
[ ] Added an entry to
CHANGELOG.mdif knowledge of this change could be valuable to users -
[ ] Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
-
[ ] Created or updated an example program if it would help users understand this functionality
-
[ ] Updated feature matrix, if new features were added or implemented
Thanks for taking the time to contribute (and apologies for taking so long to respond). Is this supposed to map Linux's keycodes to USB HID scancodes?
Yes it is, but actually all implementations send "OS keycodes" rather than the raw HID scancode. My patch is incomplete, I'm not event using it anymore. Furthermore, it is a breaking change.
Maybe the correct fix would be to update the documentation of winit::event::ScanCode, because the values are more "OS/Hardware-dependent keyboard scan code".
What do you think about that ?
What do you think about that?
Welp, I kind of forgot to reply before now. Basically, I think #2662 is preferable, since it would give you a proper platform-independent value instead of passing through the platform-dependent "scancode/keycode".
Thanks for your patch, but as it was stated and as it was there for years I think, the keyboard API model proposed in #2662 (the patch is new, but the PRs doing it for dedicated platforms did dated since 2020/21) took care of it.