diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-04-27 01:10:28 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-27 01:10:28 +0100 |
| commit | 80763b13ff9b8abb94654d9f5ca635003c0b5d84 (patch) | |
| tree | 746896f9d9c6c2d50496183c77e155279ef10e19 /src/managers/KeybindManager.cpp | |
| parent | 3b5d979d41daeb91b7c206ff254ced908d0c16ab (diff) | |
keybindMgr: use legacy behavior for single-key binds on lua (#14176)
Diffstat (limited to 'src/managers/KeybindManager.cpp')
| -rw-r--r-- | src/managers/KeybindManager.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index df03f920..28c57eb9 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()) { |
