summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-24 12:16:26 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-24 12:16:26 +0200
commit8dcc3032a81e8b4eec9bbe7fa657caf1b4b8db9e (patch)
tree8bf34beb853e17319c5f29cefb45ebf4de3654ed /src/managers/KeybindManager.cpp
parent1626707b7f4fd3d2b313e78cb3a41783f072f73b (diff)
fix keybinds shadowing multibinds
Diffstat (limited to 'src/managers/KeybindManager.cpp')
-rw-r--r--src/managers/KeybindManager.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index 3f723565..893313f4 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -184,7 +184,7 @@ bool CKeybindManager::handleKeybinds(const uint32_t& modmask, const std::string&
DISPATCHER->second(k.arg);
}
- shadowKeybinds();
+ shadowKeybinds(keysym == 0 ? 0 : keysym, keycode == -1 ? -1 : keycode);
found = true;
}
@@ -192,7 +192,7 @@ bool CKeybindManager::handleKeybinds(const uint32_t& modmask, const std::string&
return found;
}
-void CKeybindManager::shadowKeybinds() {
+void CKeybindManager::shadowKeybinds(const xkb_keysym_t& doesntHave, const uint32_t& doesntHaveCode) {
// shadow disables keybinds after one has been triggered
for (auto& k : m_lKeybinds) {
@@ -206,12 +206,22 @@ void CKeybindManager::shadowKeybinds() {
if ((pk == KBKEY || pk == KBKEYUPPER)) {
shadow = true;
}
+
+ if (pk == doesntHave && doesntHave != 0) {
+ shadow = false;
+ break;
+ }
}
for (auto& pk : m_dPressedKeycodes) {
if (pk == (unsigned int)k.keycode) {
shadow = true;
}
+
+ if (pk == doesntHaveCode && doesntHaveCode != 0 && doesntHaveCode != -1) {
+ shadow = false;
+ break;
+ }
}
k.shadowed = shadow;