Fix keyboard shortcuts not being mapped correctly

On systems that remap their keys, for example, to use a DVORAK keyboard layout. Fixes #29
This commit is contained in:
Kovid Goyal
2017-01-12 13:56:56 +05:30
parent 1c4718af3c
commit a8408a1ce4
2 changed files with 3 additions and 2 deletions

View File

@@ -259,7 +259,7 @@ class Boss(Thread):
self.start_cursor_blink()
self.cursor_blink_zero_time = monotonic()
if action == GLFW_PRESS or action == GLFW_REPEAT:
func = get_shortcut(self.opts.keymap, mods, key)
func = get_shortcut(self.opts.keymap, mods, key, scancode)
if func is not None:
f = getattr(self, func, None)
if f is not None:

View File

@@ -84,5 +84,6 @@ def interpret_text_event(codepoint, mods):
return data
def get_shortcut(keymap, mods, key):
def get_shortcut(keymap, mods, key, scancode):
key = get_localized_key(key, scancode)
return keymap.get((mods & 0b1111, key))