Is your feature request related to a problem? Please describe.
I'm currently working on reimplementing an existing codebase using egui and eframe. For part of this application, the keybindings SHIFT+1, SHIFT+2, SHIFT+3, and so on... are used frequently. Changing these keybindings isn't really an option as all existing users of this software practically have it burned into their memory.
The problem here is that these inputs (shift+1, etc.) are instead passed as egui::Event::Text instead of the raw scancode information. Since Shift+2 might output Text('@') or Text('"'), it's not possible to hack around this by reading the characters sent to the device.
Furthermore, things like consume_shortcut don't work with shortcuts like this.
Describe the solution you'd like
I'd like for the virtual_keycode part of winit::event::KeyboardInput to be accessible somehow from the eframe input handler. That way, I can handle this logic myself. At the moment, it is converted to a key with translate_virtual_key_code and that results in the loss of a lot of information.
Describe alternatives you've considered
I've tried checking if Num1 is pressed and modifiers.shift is pressed, but that doesn't work as the input is coerced into "!".
It's possible that I'm missing some way already to access the raw winit:: events that already exists?
Additional context
I don't know much about the egui codebase or where this could nicely fit in as a feature. Strapping it onto egui::Event::Key could work, but seems unorthodox. Some sort of alternative place to access "raw" winit input would be potentially interesting too.
I'd be willing to work on this if there were some pointers on how this could fit in.
Is your feature request related to a problem? Please describe.
I'm currently working on reimplementing an existing codebase using
eguiandeframe. For part of this application, the keybindings SHIFT+1, SHIFT+2, SHIFT+3, and so on... are used frequently. Changing these keybindings isn't really an option as all existing users of this software practically have it burned into their memory.The problem here is that these inputs (shift+1, etc.) are instead passed as
egui::Event::Textinstead of the raw scancode information. Since Shift+2 might outputText('@')orText('"'), it's not possible to hack around this by reading the characters sent to the device.Furthermore, things like
consume_shortcutdon't work with shortcuts like this.Describe the solution you'd like
I'd like for the
virtual_keycodepart ofwinit::event::KeyboardInputto be accessible somehow from the eframe input handler. That way, I can handle this logic myself. At the moment, it is converted to a key withtranslate_virtual_key_codeand that results in the loss of a lot of information.Describe alternatives you've considered
I've tried checking if
Num1is pressed andmodifiers.shiftis pressed, but that doesn't work as the input is coerced into"!".It's possible that I'm missing some way already to access the raw
winit::events that already exists?Additional context
I don't know much about the
eguicodebase or where this could nicely fit in as a feature. Strapping it ontoegui::Event::Keycould work, but seems unorthodox. Some sort of alternative place to access "raw" winit input would be potentially interesting too.I'd be willing to work on this if there were some pointers on how this could fit in.