keyboard: Implement key repeat for keybindings

It seems that every Wayland client is expected to implement its own
key-repeat logic, rather than doing it server-side as in X11.  This
means that labwc also has to implement its own key-repeat logic for
compositor keybindings.

This is a very simplistic timer-based implementation.  It doesn't
attempt to synthesize accurate timestamps, and may lag depending
on system load, but it appears to get the job done.

v2: Use server->wl_event_loop
v3: Comments and formatting
This commit is contained in:
John Lindgren 2022-11-02 16:37:24 -04:00 committed by Johan Malm
parent b163045fa9
commit 3b55b31070
3 changed files with 62 additions and 5 deletions

View file

@ -24,6 +24,7 @@ input_device_destroy(struct wl_listener *listener, void *data)
struct keyboard *keyboard = (struct keyboard *)input;
wl_list_remove(&keyboard->key.link);
wl_list_remove(&keyboard->modifier.link);
keyboard_cancel_keybind_repeat(keyboard);
}
free(input);
}