You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed I receive key events, for example, VirtualKeyCode::Key2 when shift is on or off. The meaning of this depends on keyboard layout, ie in UK it shift-on-key2 means ". Are there established ways of dealing with layouts at the moment? Is it planned/desired to be included in winit?
When a key is pressed, you normally receive two events:
a KeyboardInput event, which as you noted does not take into account modifiers keys like shift, this is intented for input that should not be affected by it (like action keys in a videogame)
a ReceivedCharacter event, which contains the UTF8 char generated by the keypress, including all keymap modifiers currently active, which is probably what you are looking for.
Activity
elinorbgr commentedon Jun 21, 2017
When a key is pressed, you normally receive two events:
KeyboardInputevent, which as you noted does not take into account modifiers keys like shift, this is intented for input that should not be affected by it (like action keys in a videogame)ReceivedCharacterevent, which contains the UTF8 char generated by the keypress, including all keymap modifiers currently active, which is probably what you are looking for.alexheretic commentedon Jun 21, 2017
Ah perfect, thank you for pointing that out.
Merge next back to dev branch (rust-windowing#305)