-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Issue with number key mapping #3415
Comments
The number keys stop being number keys when you hold shift. This is the code that converts the key variants from winit to egui: egui/crates/egui-winit/src/lib.rs Lines 773 to 862 in 12b6f2c
I put a |
y it's surely not easy. I've worked on editors for 20+ years and my solution was decomposing keys for that. Was always a bit of a mess. But on application level sometimes it's required unfortunately. There is a conflict between shortcut keys and text input that's not really modelled well on OS level. The hacky solution we used for gtk doesn't help here, but shows the way: For solving that you need access to something like that: The raw keys get mapped to real keys let's say shift+1 maps to ! and on app level you get '!' - that needs to be taken back. It's tricky and unfortunately I don't know enough about the VirtualKeyCode thing there to be really helpful. |
0.25 improved key input but I stll don't get a key event for shift+number - only the text event. |
You should get an #3653 explains physical vs logical keys. See https://docs.rs/egui/latest/egui/enum.Event.html#variant.Key.field.physical_key The docs could be improved here, but as you see, physical keys are not yet implemented in eframe web |
Seems I don't get egui::Event::Key events for the number keys when shift is pressed - works with any other modifier.
And shift seems to work with other keys as well, but the numbers:
The text was updated successfully, but these errors were encountered: