diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-04-18 23:19:23 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-04-18 23:19:23 +1000 |
commit | 5b30391383be7e31ae1b213f2a6095bd7a95defc (patch) | |
tree | 96ad3f77bf2538401d5538e0e0ba9c12c99f32b6 /sway/config/input.c | |
parent | Merge pull request #1819 from emersion/destroy-display (diff) | |
download | sway-5b30391383be7e31ae1b213f2a6095bd7a95defc.tar.gz sway-5b30391383be7e31ae1b213f2a6095bd7a95defc.tar.zst sway-5b30391383be7e31ae1b213f2a6095bd7a95defc.zip |
Make key repeat configurable
This creates two input commands for configuring the repeat delay and rate.
Example config:
input "myidentifier" {
repeat_delay 250
repeat_rate 25
}
Diffstat (limited to 'sway/config/input.c')
-rw-r--r-- | sway/config/input.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sway/config/input.c b/sway/config/input.c index 5e657c43..a9f20723 100644 --- a/sway/config/input.c +++ b/sway/config/input.c | |||
@@ -29,6 +29,8 @@ struct input_config *new_input_config(const char* identifier) { | |||
29 | input->pointer_accel = FLT_MIN; | 29 | input->pointer_accel = FLT_MIN; |
30 | input->scroll_method = INT_MIN; | 30 | input->scroll_method = INT_MIN; |
31 | input->left_handed = INT_MIN; | 31 | input->left_handed = INT_MIN; |
32 | input->repeat_delay = INT_MIN; | ||
33 | input->repeat_rate = INT_MIN; | ||
32 | 34 | ||
33 | return input; | 35 | return input; |
34 | } | 36 | } |
@@ -59,6 +61,12 @@ void merge_input_config(struct input_config *dst, struct input_config *src) { | |||
59 | if (src->pointer_accel != FLT_MIN) { | 61 | if (src->pointer_accel != FLT_MIN) { |
60 | dst->pointer_accel = src->pointer_accel; | 62 | dst->pointer_accel = src->pointer_accel; |
61 | } | 63 | } |
64 | if (src->repeat_delay != INT_MIN) { | ||
65 | dst->repeat_delay = src->repeat_delay; | ||
66 | } | ||
67 | if (src->repeat_rate != INT_MIN) { | ||
68 | dst->repeat_rate = src->repeat_rate; | ||
69 | } | ||
62 | if (src->scroll_method != INT_MIN) { | 70 | if (src->scroll_method != INT_MIN) { |
63 | dst->scroll_method = src->scroll_method; | 71 | dst->scroll_method = src->scroll_method; |
64 | } | 72 | } |