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.
This commit is contained in:
frsfnrrg 2018-07-29 16:25:43 -04:00
parent ca8f177e14
commit e33dfbfa75
2 changed files with 43 additions and 0 deletions

View file

@ -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,