This commit is contained in:
Danylov Ihor 2026-05-06 23:34:05 +02:00 committed by GitHub
commit 74423201f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 3 deletions

View file

@ -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"
@ -915,6 +917,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

View file

@ -500,6 +500,8 @@ std::vector<SP<IValue>> Values::getConfigValues() {
MS<Bool>("binds:allow_pin_fullscreen", "Allows fullscreen to pinned windows, and restore their pinned status afterwards", false),
MS<Int>("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<int>::max()}),
MS<Int>("binds:repeat_rate", "if 0, will use input:repeat_rate / how frequently bind repeats", 0, {.min = 0, .max = 200}),
MS<Int>("binds:repeat_delay", "if 0, will use input:repeat_delay / delay before bind starts repeating", 0, {.min = 0, .max = 2000}),
/*
* xwayland:

View file

@ -562,6 +562,8 @@ SSubmap CKeybindManager::getCurrentSubmap() {
SDispatchResult CKeybindManager::handleKeybinds(const uint32_t modmask, const SPressedKeyWithMods& key, bool pressed, SP<IKeyboard> keyboard, SP<IHID> device) {
static auto PDISABLEINHIBIT = CConfigValue<Config::INTEGER>("binds:disable_keybind_grabbing");
static auto PDRAGTHRESHOLD = CConfigValue<Config::INTEGER>("binds:drag_threshold");
static auto PREPEATRATE = CConfigValue<Config::INTEGER>("binds:repeat_rate");
static auto PREPEATDELAY = CConfigValue<Config::INTEGER>("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))