From 326b4aebd1ad0130e289b812c3c76b615509a52a Mon Sep 17 00:00:00 2001 From: ARDiDo <90479315+ARDiDo@users.noreply.github.com> Date: Sat, 9 Oct 2021 15:16:02 -0400 Subject: [PATCH] keyboard repeat configuration --- include/config/rcxml.h | 2 ++ src/config/rcxml.c | 6 ++++++ src/keyboard.c | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/config/rcxml.h b/include/config/rcxml.h index 2ab7904e..f27e4836 100644 --- a/include/config/rcxml.h +++ b/include/config/rcxml.h @@ -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; diff --git a/src/config/rcxml.c b/src/config/rcxml.c index afd504f9..3b318632 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -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 { diff --git a/src/keyboard.c b/src/keyboard.c index 7c9fc7a7..fc3ef64f 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -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);