diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-04-18 23:57:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-18 23:57:28 -0400 |
commit | 2f0120e458cae47f38a3c09af174bae60964151c (patch) | |
tree | ec383be2db8def6d41c06cc4333ef6175b105b1a /sway/input | |
parent | d668d5789238f1e2865599cf1b7ffeb518ee8318 (diff) | |
parent | 9ab61716b5017fc2aec3ed03bd4687dfb8c5fe9f (diff) |
Merge pull request #1823 from RyanDwyer/key-repeat
Make key repeat configurable
Diffstat (limited to 'sway/input')
-rw-r--r-- | sway/input/keyboard.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c index dbb0c359..dbf2ce01 100644 --- a/sway/input/keyboard.c +++ b/sway/input/keyboard.c @@ -1,4 +1,5 @@ #include <assert.h> +#include <limits.h> #include <wlr/backend/multi.h> #include <wlr/backend/session.h> #include "sway/input/seat.h" @@ -479,7 +480,13 @@ void sway_keyboard_configure(struct sway_keyboard *keyboard) { keyboard->keymap = keymap; wlr_keyboard_set_keymap(wlr_device->keyboard, keyboard->keymap); - wlr_keyboard_set_repeat_info(wlr_device->keyboard, 25, 600); + if (input_config && input_config->repeat_delay != INT_MIN + && input_config->repeat_rate != INT_MIN) { + wlr_keyboard_set_repeat_info(wlr_device->keyboard, + input_config->repeat_rate, input_config->repeat_delay); + } else { + wlr_keyboard_set_repeat_info(wlr_device->keyboard, 25, 600); + } xkb_context_unref(context); struct wlr_seat *seat = keyboard->seat_device->sway_seat->wlr_seat; wlr_seat_set_keyboard(seat, wlr_device); |