Skip to content
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

linux: Send scancode instead of keycodes #2285

Closed
wants to merge 1 commit into from

Conversation

rofferom
Copy link

@rofferom rofferom commented May 9, 2022

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:

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
@maroider
Copy link
Member

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?

@rofferom
Copy link
Author

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 ?

@maroider
Copy link
Member

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".

@kchibisov
Copy link
Member

kchibisov commented May 28, 2023

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.

@kchibisov kchibisov closed this May 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

4 participants