From 44c6f9a9cf3678ff470ae2955c70d8984fad0f31 Mon Sep 17 00:00:00 2001 From: lapLapych Date: Mon, 20 Apr 2026 21:16:34 +0300 Subject: [PATCH 1/2] feat(keybind-manager): add repeat delay and rate to binds config Add new config options `binds:repeat_delay` and `binds:repeat_rate` (INT, 0-inf, default use input variable) --- meta/hl.meta.lua | 4 ++++ src/config/values/ConfigValues.cpp | 2 ++ src/managers/KeybindManager.cpp | 9 ++++++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/meta/hl.meta.lua b/meta/hl.meta.lua index 6ea875aee..9bbfcbe61 100644 --- a/meta/hl.meta.lua +++ b/meta/hl.meta.lua @@ -45,6 +45,8 @@ ---| "binds.movefocus_cycles_fullscreen" ---| "binds.movefocus_cycles_groupfirst" ---| "binds.pass_mouse_when_bound" +---| "binds.repeat_delay" +---| "binds.repeat_rate" ---| "binds.scroll_event_delay" ---| "binds.window_direction_monitor_fallback" ---| "binds.workspace_back_and_forth" @@ -881,6 +883,8 @@ hl = {} ---@field ['binds.movefocus_cycles_fullscreen'] boolean ---@field ['binds.movefocus_cycles_groupfirst'] boolean ---@field ['binds.pass_mouse_when_bound'] boolean +---@field ['binds.repeat_delay'] integer|boolean +---@field ['binds.repeat_rate'] integer|boolean ---@field ['binds.scroll_event_delay'] integer|boolean ---@field ['binds.window_direction_monitor_fallback'] boolean ---@field ['binds.workspace_back_and_forth'] boolean diff --git a/src/config/values/ConfigValues.cpp b/src/config/values/ConfigValues.cpp index 2c44b1722..26505d083 100644 --- a/src/config/values/ConfigValues.cpp +++ b/src/config/values/ConfigValues.cpp @@ -500,6 +500,8 @@ std::vector> Values::getConfigValues() { MS("binds:allow_pin_fullscreen", "Allows fullscreen to pinned windows, and restore their pinned status afterwards", false), MS("binds:drag_threshold", "Movement threshold in pixels for window dragging and c/g bind flags. 0 to disable.", 0, {.min = 0, .max = std::numeric_limits::max()}), + MS("binds:repeat_rate", "if 0, will use input:repeat_rate / how frequently bind repeats", 0), + MS("binds:repeat_delay", "if 0, will use input:repeat_delay / delay before bind starts repeating", 0), /* * xwayland: diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index c9b5650aa..912a390b0 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -562,6 +562,8 @@ SSubmap CKeybindManager::getCurrentSubmap() { SDispatchResult CKeybindManager::handleKeybinds(const uint32_t modmask, const SPressedKeyWithMods& key, bool pressed, SP keyboard, SP device) { static auto PDISABLEINHIBIT = CConfigValue("binds:disable_keybind_grabbing"); static auto PDRAGTHRESHOLD = CConfigValue("binds:drag_threshold"); + static auto PREPEATRATE = CConfigValue("binds:repeat_rate"); + static auto PREPEATDELAY = CConfigValue("binds:repeat_delay"); bool found = false; SDispatchResult res; @@ -755,11 +757,12 @@ SDispatchResult CKeybindManager::handleKeybinds(const uint32_t modmask, const SP } if (pressed && k->repeat) { - const auto KEEB = keyboard ? keyboard : g_pSeatManager->m_keyboard.lock(); - m_repeatKeyRate = KEEB->m_repeatRate; + const auto KEEB = keyboard ? keyboard : g_pSeatManager->m_keyboard.lock(); + m_repeatKeyRate = (*PREPEATRATE <= 0) ? KEEB->m_repeatRate : *PREPEATRATE; + auto repeatDelay = (*PREPEATDELAY <= 0) ? KEEB->m_repeatDelay : *PREPEATDELAY; m_activeKeybinds.emplace_back(k); - m_repeatKeyTimer->updateTimeout(std::chrono::milliseconds(KEEB->m_repeatDelay)); + m_repeatKeyTimer->updateTimeout(std::chrono::milliseconds(repeatDelay)); } if (!k->nonConsuming && !(k->autoConsuming && !res.success)) From b5db6ca08f61660cf05fade855a78836ea4559a2 Mon Sep 17 00:00:00 2001 From: lapLapych Date: Wed, 29 Apr 2026 23:50:16 +0300 Subject: [PATCH 2/2] fix(config-values): add min, max values for binds:repeat_delay/repeat_rate Signed-off-by: lapLapych --- src/config/values/ConfigValues.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config/values/ConfigValues.cpp b/src/config/values/ConfigValues.cpp index 26505d083..97c095831 100644 --- a/src/config/values/ConfigValues.cpp +++ b/src/config/values/ConfigValues.cpp @@ -500,8 +500,8 @@ std::vector> Values::getConfigValues() { MS("binds:allow_pin_fullscreen", "Allows fullscreen to pinned windows, and restore their pinned status afterwards", false), MS("binds:drag_threshold", "Movement threshold in pixels for window dragging and c/g bind flags. 0 to disable.", 0, {.min = 0, .max = std::numeric_limits::max()}), - MS("binds:repeat_rate", "if 0, will use input:repeat_rate / how frequently bind repeats", 0), - MS("binds:repeat_delay", "if 0, will use input:repeat_delay / delay before bind starts repeating", 0), + MS("binds:repeat_rate", "if 0, will use input:repeat_rate / how frequently bind repeats", 0, {.min = 0, .max = 200}), + MS("binds:repeat_delay", "if 0, will use input:repeat_delay / delay before bind starts repeating", 0, {.min = 0, .max = 2000}), /* * xwayland: