diff options
author | frsfnrrg <frsfnrrg@users.noreply.github.com> | 2018-07-29 16:25:43 -0400 |
---|---|---|
committer | frsfnrrg <frsfnrrg@users.noreply.github.com> | 2018-07-29 19:15:02 -0400 |
commit | e33dfbfa758fb899c276135d06f25359ceee0002 (patch) | |
tree | 2ac9007d59e001f16c92dd43cb9e961fd043257f /include | |
parent | Merge pull request #2379 from emersion/xwayland-unmanaged (diff) | |
download | sway-e33dfbfa758fb899c276135d06f25359ceee0002.tar.gz sway-e33dfbfa758fb899c276135d06f25359ceee0002.tar.zst sway-e33dfbfa758fb899c276135d06f25359ceee0002.zip |
Implement key repeat for pressed key bindings
Each sway_keyboard is provided with a wayland timer event source.
When a valid keypress binding has been found, a callback to
handle_keyboard_repeat is set. Any key event will either clear
the callback or (if the new key event is a valid keypress binding)
delay the callback again.
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/input/keyboard.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/sway/input/keyboard.h b/include/sway/input/keyboard.h index 6713398e..660cdc9c 100644 --- a/include/sway/input/keyboard.h +++ b/include/sway/input/keyboard.h | |||
@@ -38,6 +38,11 @@ struct sway_keyboard { | |||
38 | struct sway_shortcut_state state_keysyms_raw; | 38 | struct sway_shortcut_state state_keysyms_raw; |
39 | struct sway_shortcut_state state_keycodes; | 39 | struct sway_shortcut_state state_keycodes; |
40 | struct sway_binding *held_binding; | 40 | struct sway_binding *held_binding; |
41 | |||
42 | struct wl_event_source *key_repeat_source; | ||
43 | struct sway_binding *repeat_binding; | ||
44 | int key_repeat_initial_delay; // first key repeat event delay, in ms | ||
45 | int key_repeat_step_delay; // subsequent repeat delay, in ms | ||
41 | }; | 46 | }; |
42 | 47 | ||
43 | struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat, | 48 | struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat, |