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/sway/input/keyboard.h | |
parent | ca8f177e143de81af3c050e6dc01b7ecebaeea34 (diff) |
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/sway/input/keyboard.h')
-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 { struct sway_shortcut_state state_keysyms_raw; struct sway_shortcut_state state_keycodes; struct sway_binding *held_binding; + + struct wl_event_source *key_repeat_source; + struct sway_binding *repeat_binding; + int key_repeat_initial_delay; // first key repeat event delay, in ms + int key_repeat_step_delay; // subsequent repeat delay, in ms }; struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat, |