-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
API to view raw winit events (particularly keyboard inputs) #3266
Comments
If you have an idea of what the API should look like, I'd be happy to implement it and submit a PR. |
Perhaps this should also wait on #2023 |
@HactarCE That links to an unresolved bug. Is it the correct reference for what solves this? |
🤦 I mixed up the numbers. Should've been #2977. |
After some more careful reading of the docs, this is not resolved by the recent updates. In particular, I can't distinguish numpad keys, and scan codes aren't available on web. It might seem nice to keep physical and logical key the same but they are fundamentally very different things and should be treated as such; they just happen to align most of the time on QWERTY. I'll still keep this closed in favor of #3653 |
Is your feature request related to a problem? Please describe.
In Hyperspeedcube (repo, website, online demo) the user has the ability to bind keys to scancodes rather than keycodes, which use my
key-names
crate to abstract over platform specifics. I would love to use eframe for Hyperspeedcube, but I need access to low-level keyboard input information. I even want platform-specific keys, so that users can bind every key on their keyboard for speedsolving.This is also useful for first-person games or 3D movement controls where position on the keyboard matters more than keycode, so controls should use scancodes rather than keycodes to be more keyboard-layout-independent.
Describe the solution you'd like
I would like some API for accessing raw winit events, or at least keyboard events, when using eframe with winit. These events will necessarily be platform-specific, but that's ok as it's an escape hatch like
EventLoopBuilderHook
.For maximum flexibility, this could be a handler that can alter, delete, or construct winit events to be sent to eframe, but really all I need is to see them at some point during the frame so that I can do my own handling. Some of my users have wanted to bind the tab key, but this is reserved in egui for accessibility reasons. If I could, I'd add an option to my application to override the tab key in certain contexts if the user has bound a custom action to it.
Describe alternatives you've considered
key-names
crate with all its features. I didn't write that crate with widespread use in mind (it's not even on crates.io) but that is an option.The text was updated successfully, but these errors were encountered: