summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar frsfnrrg <frsfnrrg@users.noreply.github.com>2018-06-12 11:07:11 -0400
committerLibravatar frsfnrrg <frsfnrrg@users.noreply.github.com>2018-06-12 20:26:57 -0400
commitca061ba8bf94e1d09e1d912871841212778044ed (patch)
tree855a5886f90dd555ae1057049d8d802d0c2b5cfb /include
parentSort binding key lists (diff)
downloadsway-ca061ba8bf94e1d09e1d912871841212778044ed.tar.gz
sway-ca061ba8bf94e1d09e1d912871841212778044ed.tar.zst
sway-ca061ba8bf94e1d09e1d912871841212778044ed.zip
Fix keyboard shortcut handling inconsistencies
* Ensure that modifier keys are identified even when the next key does not produce a keysym. This requires that modifier change tracking be done for each sway_shortcut_state. * Permit regular and --release shortcuts on the same key combination. Distinct bindings are identified for press and release cases; note that the release binding needs to be identified for both key press and key release events. * Maintain ascending sort order for the shortcut state list, and keep track of the number of pressed key ids, for simpler (and hence faster) searching of the list of key bindings. * Move binding duplicate detection into get_active_binding to avoid duplicating error messages.
Diffstat (limited to 'include')
-rw-r--r--include/sway/input/keyboard.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/sway/input/keyboard.h b/include/sway/input/keyboard.h
index e99a54b1..6713398e 100644
--- a/include/sway/input/keyboard.h
+++ b/include/sway/input/keyboard.h
@@ -21,7 +21,9 @@ struct sway_shortcut_state {
21 * including duplicates when a keycode generates multiple key ids. 21 * including duplicates when a keycode generates multiple key ids.
22 */ 22 */
23 uint32_t pressed_keycodes[SWAY_KEYBOARD_PRESSED_KEYS_CAP]; 23 uint32_t pressed_keycodes[SWAY_KEYBOARD_PRESSED_KEYS_CAP];
24 int last_key_index; 24 uint32_t last_keycode;
25 uint32_t last_raw_modifiers;
26 size_t npressed;
25}; 27};
26 28
27struct sway_keyboard { 29struct sway_keyboard {
@@ -36,7 +38,6 @@ struct sway_keyboard {
36 struct sway_shortcut_state state_keysyms_raw; 38 struct sway_shortcut_state state_keysyms_raw;
37 struct sway_shortcut_state state_keycodes; 39 struct sway_shortcut_state state_keycodes;
38 struct sway_binding *held_binding; 40 struct sway_binding *held_binding;
39 uint32_t last_modifiers;
40}; 41};
41 42
42struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat, 43struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat,