summaryrefslogtreecommitdiff
path: root/src/managers/input/InputManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-09 23:24:08 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-09 23:24:08 +0200
commit6f7377f38138af5e41f094fbae90b4f68e94d49b (patch)
treec1c5d649ce5cf6840c15c6eb92eecbaadbbd2362 /src/managers/input/InputManager.cpp
parentc44cafda9723e268dcedd71eb2f9b918429bbd0f (diff)
accumulate mods from all kbs for keybind processing
Diffstat (limited to 'src/managers/input/InputManager.cpp')
-rw-r--r--src/managers/input/InputManager.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index 883b5b5e..c2c154f1 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -595,7 +595,7 @@ void CInputManager::onKeyboardKey(wlr_keyboard_key_event* e, SKeyboard* pKeyboar
const xkb_keysym_t* keysyms;
int syms = xkb_state_key_get_syms(pKeyboard->keyboard->keyboard->xkb_state, KEYCODE, &keysyms);
- const auto MODS = wlr_keyboard_get_modifiers(pKeyboard->keyboard->keyboard);
+ const auto MODS = accumulateModsFromAllKBs();
wlr_idle_notify_activity(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat);
@@ -735,4 +735,15 @@ void CInputManager::updateCapabilities(wlr_input_device* pDev) {
}
wlr_seat_set_capabilities(g_pCompositor->m_sSeat.seat, m_uiCapabilities);
+}
+
+uint32_t CInputManager::accumulateModsFromAllKBs() {
+
+ uint32_t finalMask = 0;
+
+ for (auto& kb : m_lKeyboards) {
+ finalMask |= wlr_keyboard_get_modifiers(kb.keyboard->keyboard);
+ }
+
+ return finalMask;
} \ No newline at end of file