diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-06-28 16:16:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-28 16:16:31 -0700 |
commit | d3ea07f8283385d015e1d85b5fe9bc8a776fc7b4 (patch) | |
tree | 4218bb2357fb1a8ce531cf883530060cc347ec92 | |
parent | Merge pull request #2170 from apreiml/master (diff) | |
parent | fix handling key modifiers if not pressed at first (diff) | |
download | sway-d3ea07f8283385d015e1d85b5fe9bc8a776fc7b4.tar.gz sway-d3ea07f8283385d015e1d85b5fe9bc8a776fc7b4.tar.zst sway-d3ea07f8283385d015e1d85b5fe9bc8a776fc7b4.zip |
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, | |||
64 | bool last_key_was_a_modifier = raw_modifiers != state->last_raw_modifiers; | 64 | bool last_key_was_a_modifier = raw_modifiers != state->last_raw_modifiers; |
65 | state->last_raw_modifiers = raw_modifiers; | 65 | state->last_raw_modifiers = raw_modifiers; |
66 | 66 | ||
67 | if (event->state == WLR_KEY_PRESSED) { | 67 | if (last_key_was_a_modifier && state->last_keycode) { |
68 | if (last_key_was_a_modifier && state->last_keycode) { | 68 | // Last pressed key before this one was a modifier |
69 | // Last pressed key before this one was a modifier | 69 | state_erase_key(state, state->last_keycode); |
70 | state_erase_key(state, state->last_keycode); | 70 | } |
71 | } | ||
72 | 71 | ||
72 | if (event->state == WLR_KEY_PRESSED) { | ||
73 | // Add current key to set; there may be duplicates | 73 | // Add current key to set; there may be duplicates |
74 | state_add_key(state, event->keycode, new_key); | 74 | state_add_key(state, event->keycode, new_key); |
75 | state->last_keycode = event->keycode; | 75 | state->last_keycode = event->keycode; |