From 80763b13ff9b8abb94654d9f5ca635003c0b5d84 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Mon, 27 Apr 2026 01:10:28 +0100 Subject: [PATCH] keybindMgr: use legacy behavior for single-key binds on lua (#14176) --- src/managers/KeybindManager.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index df03f9208..28c57eb9a 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -580,8 +580,24 @@ SDispatchResult CKeybindManager::handleKeybinds(const uint32_t modmask, const SP case MK_FULL_MATCH: found = true; } } else if (!k->sMkKeys.empty() && key.keyName.empty()) { - if (!k->release && mkKeysymSetMatches(k->sMkKeys, m_mkKeys) != MK_FULL_MATCH) - continue; + // we have a mkKeys array, and no key name. + // for binds with one key, use the legacy matching. + // for multi-key, use proper matching + const bool HAS_MULTIPLE_KEYS = k->sMkKeys.size() > 1; + + if (HAS_MULTIPLE_KEYS) { + // check if we match fully and aren't releasing + // for multi-key binds, this is a requirement, + // but for single-key ones, this would fuck up user's expectations + // where SUPER + X could be blocked because you did SUPER + A and haven't released A yet. + // the downside? SUPER + K and SUPER + K + A will trigger two binds on SUPER + K + A + if (!k->release && mkKeysymSetMatches(k->sMkKeys, m_mkKeys) != MK_FULL_MATCH) + continue; + } + + // check for just the one match + // this is also needed for multi-key binds so that SUPER + A + K can't + // be actuated by SUPER + K + A if (key.keysym != k->sMkKeys.back()) continue; } else if (!key.keyName.empty()) {