diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2018-06-28 16:16:31 -0700 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2018-06-28 16:16:31 -0700 |
| commit | 92c9526b80ee5b5dbf4d24bdc13fc7e65814fb72 (patch) | |
| tree | 4218bb2357fb1a8ce531cf883530060cc347ec92 | |
| parent | ec9956622a74a77e8ba074e2e3b7116066e09dc6 (diff) | |
| parent | 4f61f4a3d00f161b2959844d8dfa8039832fcd01 (diff) | |
Merge pull request #2172 from apreiml/fix-keybinding-modifier-handling
fix handling key modifiers if not pressed at first
| -rw-r--r-- | sway/input/keyboard.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c index 9e093828..ec149d06 100644 --- a/sway/input/keyboard.c +++ b/sway/input/keyboard.c @@ -64,12 +64,12 @@ static void update_shortcut_state(struct sway_shortcut_state *state, bool last_key_was_a_modifier = raw_modifiers != state->last_raw_modifiers; state->last_raw_modifiers = raw_modifiers; - if (event->state == WLR_KEY_PRESSED) { - if (last_key_was_a_modifier && state->last_keycode) { - // Last pressed key before this one was a modifier - state_erase_key(state, state->last_keycode); - } + if (last_key_was_a_modifier && state->last_keycode) { + // Last pressed key before this one was a modifier + state_erase_key(state, state->last_keycode); + } + if (event->state == WLR_KEY_PRESSED) { // Add current key to set; there may be duplicates state_add_key(state, event->keycode, new_key); state->last_keycode = event->keycode; |
