From a82f12dd2bc80d692ce6e13b3521b942027ee7cf Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Mon, 5 Aug 2019 19:33:01 +0200 Subject: input: use a timer fd to handle keyboard key repeat Instead of running a repeater thread that writes the key to repeat over a pipe, use a simple timer fd. No more locking or condition signalling. No need to track start/stop/exist states. We simply set up the initial timeout value to be the 'delay', and the interval to be the repeat 'rate'. --- terminal.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'terminal.h') diff --git a/terminal.h b/terminal.h index 195ad26b..4a090f91 100644 --- a/terminal.h +++ b/terminal.h @@ -156,12 +156,7 @@ struct kbd { struct xkb_compose_table *xkb_compose_table; struct xkb_compose_state *xkb_compose_state; struct { - mtx_t mutex; - cnd_t cond; - int trigger; - int pipe_read_fd; - int pipe_write_fd; - enum {REPEAT_STOP, REPEAT_START, REPEAT_EXIT} cmd; + int fd; bool dont_re_repeat; int32_t delay; -- cgit v1.3