From 003a9302856897830716ea97a5e76290656a4107 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 24 Apr 2013 17:02:52 +0200 Subject: [PATCH] input: adjust wait time for key-repeat Basically, these are additional timers that can expire without making the central select() exit. --- core/input/input.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/input/input.c b/core/input/input.c index 3f147c30e2..4f97189d1d 100644 --- a/core/input/input.c +++ b/core/input/input.c @@ -1367,6 +1367,10 @@ static void read_key_fd(struct input_ctx *ictx, struct input_fd *key_fd) */ static void read_events(struct input_ctx *ictx, int time) { + if (ictx->num_key_down) { + time = FFMIN(time, 1000 / ictx->ar_rate); + time = FFMIN(time, ictx->ar_delay); + } ictx->got_new_events = false; struct input_fd *key_fds = ictx->key_fds; struct input_fd *cmd_fds = ictx->cmd_fds;