commit d3ea07f8283385d015e1d85b5fe9bc8a776fc7b4
parent 92e81df470b040f57f020cef4d8dec67097d0ed6
Author: Drew DeVault <sir@cmpwn.com>
Date: Thu, 28 Jun 2018 16:16:31 -0700
Merge pull request #2172 from apreiml/fix-keybinding-modifier-handling
fix handling key modifiers if not pressed at first
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git 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;