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

Improve keyinput on non us layouts #3001

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sorcerersr
Copy link

Improves keymapping for non english keyboard layouts (#2731)

On non english keyboard layouts the logical_key and the physical_key of the KeyEvent may differ e.g.

physical_key: Code(KeyZ), logical_key: Character("y")

which is mapped to a KeyPress struct with values

KeyPress { key: Keyboard(Character("y"), Code(KeyZ)), mods: ModifiersState(CONTROL) }

This PR uses the value of the logical_key to get a KeyInput with a matching Keycode which leads to
a KeyPress with matching Character and Code:

KeyPress { key: Keyboard(Character("y"), Code(KeyY)), mods: ModifiersState(CONTROL) }

or

KeyPress { key: Keyboard(Character("z"), Code(KeyZ)), mods: ModifiersState(CONTROL) }

This fixes many keybindings like Ctrl+Z (#2775).

Unfortunately not all keybindings are fixed. For example Ctrl+= is still not working.
On a german keyboard the equal sign "=" is reached by pressing Shift+0.
The KeyEvent for this case will be Ctrl+Shift+= which obiously doesn't match the keybind Ctrl+=.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant