mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-22 05:33:45 -04:00
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'.
This commit is contained in:
parent
c62ce72778
commit
a82f12dd2b
3 changed files with 65 additions and 156 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue