Fix using modifiers with subsequent keys in a muti-key shortcut not working

This commit is contained in:
Kovid Goyal 2018-04-24 09:42:37 +05:30
parent f5abe7cbf7
commit fe5b8f3aec
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 2 deletions

View File

@ -86,7 +86,10 @@ on_key_input(int key, int scancode, int action, int mods, const char* text, int
Window *w = active_window(); Window *w = active_window();
if (!w) return; if (!w) return;
if (global_state.in_sequence_mode) { if (global_state.in_sequence_mode) {
if (action != GLFW_RELEASE) call_boss(process_sequence, "iiii", key, scancode, action, mods); if (
action != GLFW_RELEASE &&
key != GLFW_KEY_LEFT_SHIFT && key != GLFW_KEY_RIGHT_SHIFT && key != GLFW_KEY_LEFT_ALT && key != GLFW_KEY_RIGHT_ALT && key != GLFW_KEY_LEFT_CONTROL && key != GLFW_KEY_RIGHT_CONTROL
) call_boss(process_sequence, "iiii", key, scancode, action, mods);
return; return;
} }
Screen *screen = w->render_data.screen; Screen *screen = w->render_data.screen;

View File

@ -257,7 +257,7 @@ def get_shortcut(keymap, mods, key, scancode):
def shortcut_matches(s, mods, key, scancode): def shortcut_matches(s, mods, key, scancode):
return s[0] & 0b1111 == mods & 0b1111 and s[1] == key return defines.resolve_key_mods(s[0]) & 0b1111 == mods & 0b1111 and s[1] == key
def generate_key_table(): def generate_key_table():