diff options
author | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2016-01-04 23:26:40 +0100 |
---|---|---|
committer | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2016-01-04 23:26:40 +0100 |
commit | e62c49f83cd9de0343ce7e71db1b2446d11bb22e (patch) | |
tree | 723d89fea97299d1d1fc6f5919b1ca81765d19e1 /sway/input_state.c | |
parent | Merge pull request #429 from mikkeloscar/bar-workspace-buttons (diff) | |
download | sway-e62c49f83cd9de0343ce7e71db1b2446d11bb22e.tar.gz sway-e62c49f83cd9de0343ce7e71db1b2446d11bb22e.tar.zst sway-e62c49f83cd9de0343ce7e71db1b2446d11bb22e.zip |
Fix overwriting current pressed keys.
This fixes a bug where the key at index 0 in the `key_state_array` would
be overwritten by the next pressed key. This broke any bindings
consisting of multiple non-mod keys like: `$mod+a+b`.
Diffstat (limited to 'sway/input_state.c')
-rw-r--r-- | sway/input_state.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/input_state.c b/sway/input_state.c index 25308a77..58619d1f 100644 --- a/sway/input_state.c +++ b/sway/input_state.c | |||
@@ -36,8 +36,8 @@ static uint8_t find_key(uint32_t key_sym, uint32_t key_code, bool update) { | |||
36 | if (0 == key_sym && 0 == key_code && key_state_array[i].key_sym == 0) { | 36 | if (0 == key_sym && 0 == key_code && key_state_array[i].key_sym == 0) { |
37 | break; | 37 | break; |
38 | } | 38 | } |
39 | if (key_state_array[i].key_sym == key_sym | 39 | if (key_sym != 0 && (key_state_array[i].key_sym == key_sym |
40 | || key_state_array[i].alt_sym == key_sym) { | 40 | || key_state_array[i].alt_sym == key_sym)) { |
41 | break; | 41 | break; |
42 | } | 42 | } |
43 | if (update && key_state_array[i].key_code == key_code) { | 43 | if (update && key_state_array[i].key_code == key_code) { |