diff options
author | Simon Glass <sjg@chromium.org> | 2015-10-18 21:17:25 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-11-19 20:13:40 -0700 |
commit | 0b186c0825f710a937578dc7d2ffbe125ddee7a3 (patch) | |
tree | e1534b8250ca061850e2ef0fad72dabb91025ef3 /drivers/input | |
parent | 3a85e4362aa830c0beb2b0253c0e70102b42f066 (diff) | |
download | u-boot-imx-0b186c0825f710a937578dc7d2ffbe125ddee7a3.zip u-boot-imx-0b186c0825f710a937578dc7d2ffbe125ddee7a3.tar.gz u-boot-imx-0b186c0825f710a937578dc7d2ffbe125ddee7a3.tar.bz2 |
input: Allow repeat filtering to be disabled
Generally the input library handles processing of a list of scanned keys.
Repeated keys need to be generated based on a timer in this case, since all
that is provided is a list of keys current depressed.
Keyboards which do their own scanning will resend codes when they want to
inject a repeating key. Provide a function which tells the input library to
accept repeating keys and not to try to second-guess the caller.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/input.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c index 530bf51..fc1c45c 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -413,8 +413,8 @@ static int _input_send_keycodes(struct input_config *config, int keycode[], * insert another character if we later realise that we * have missed a repeat slot. */ - is_repeat = config->repeat_rate_ms && - (int)get_timer(config->next_repeat_ms) >= 0; + is_repeat = config->allow_repeats || (config->repeat_rate_ms && + (int)get_timer(config->next_repeat_ms) >= 0); if (!is_repeat) return 0; } @@ -495,6 +495,11 @@ void input_set_delays(struct input_config *config, int repeat_delay_ms, config->repeat_rate_ms = repeat_rate_ms; } +void input_allow_repeats(struct input_config *config, bool allow_repeats) +{ + config->allow_repeats = allow_repeats; +} + int input_add_tables(struct input_config *config) { int ret; |