]> git.mdlowis.com Git - proto/labwc.git/commitdiff
keyboard repeat configuration
authorARDiDo <90479315+ARDiDo@users.noreply.github.com>
Sat, 9 Oct 2021 19:16:02 +0000 (15:16 -0400)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sun, 10 Oct 2021 10:34:48 +0000 (11:34 +0100)
include/config/rcxml.h
src/config/rcxml.c
src/keyboard.c

index 2ab7904e55a339f0071e6c2cb6f5457cc395e559..f27e4836b7c06ce9ad032069d5d27c822cf624e7 100644 (file)
@@ -29,6 +29,8 @@ struct rcxml {
        enum libinput_config_accel_profile accel_profile;
        enum libinput_config_middle_emulation_state middle_emu;
        enum libinput_config_dwt_state dwt;
+       int repeat_rate;
+       int repeat_delay;
 };
 
 extern struct rcxml rc;
index afd504f94add18dc387e9d9f5450f406d01b4748..3b31863219764549c715ed532e692f64eb35d0a5 100644 (file)
@@ -271,6 +271,10 @@ entry(xmlNode *node, char *nodename, char *content)
                                LIBINPUT_CONFIG_DWT_DISABLED;
        } else if (!strcasecmp(nodename, "AccelerationProfile.libinput")) {
                rc.accel_profile = get_accel_profile(content);
+       } else if (!strcasecmp(nodename, "RepeatRate.keyboard")) {
+               rc.repeat_rate = atoi(content);
+       } else if (!strcasecmp(nodename, "RepeatDelay.keyboard")) {
+               rc.repeat_delay = atoi(content);
        }
 }
 
@@ -362,6 +366,8 @@ rcxml_init()
        rc.accel_profile = -1;
        rc.middle_emu = -1;
        rc.dwt = -1;
+       rc.repeat_rate = 25;
+       rc.repeat_delay = 600;
 }
 
 static struct {
index 7c9fc7a75add54eb33839bbcea52b94b12de9e73..fc3ef64f72e24aa879bf24328625aa556ee15b1b 100644 (file)
@@ -159,7 +159,7 @@ keyboard_init(struct seat *seat)
        wlr_keyboard_set_keymap(kb, keymap);
        xkb_keymap_unref(keymap);
        xkb_context_unref(context);
-       wlr_keyboard_set_repeat_info(kb, 25, 600);
+       wlr_keyboard_set_repeat_info(kb, rc.repeat_rate, rc.repeat_delay);
 
        seat->keyboard_key.notify = keyboard_key_notify;
        wl_signal_add(&kb->events.key, &seat->keyboard_key);