diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-03-02 01:46:16 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-03-02 01:46:55 +0000 |
| commit | 7ce781e87cf7cf789a54d37af7d78f1c11d66dbc (patch) | |
| tree | df83040065961dcfd48eb713da1355c652238d77 /src/managers/input/InputManager.cpp | |
| parent | b2c34404777ea0850f90f4c38f64484f03599d14 (diff) | |
keybinds: better follow xkb translation state
fixes #4908
Diffstat (limited to 'src/managers/input/InputManager.cpp')
| -rw-r--r-- | src/managers/input/InputManager.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 5944ba87..989d863a 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -908,11 +908,10 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) { KEYMAP = xkb_keymap_new_from_names(CONTEXT, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS); } - xkb_state_unref(pKeyboard->xkbTranslationState); - pKeyboard->xkbTranslationState = xkb_state_new(KEYMAP); - wlr_keyboard_set_keymap(wlr_keyboard_from_input_device(pKeyboard->keyboard), KEYMAP); + pKeyboard->updateXKBTranslationState(); + wlr_keyboard_modifiers wlrMods = {0}; if (NUMLOCKON == 1) { @@ -1246,6 +1245,8 @@ void CInputManager::onKeyboardMod(void* data, SKeyboard* pKeyboard) { const auto LAYOUT = getActiveLayoutForKeyboard(pKeyboard); + pKeyboard->updateXKBTranslationState(); + g_pEventManager->postEvent(SHyprIPCEvent{"activelayout", pKeyboard->name + "," + LAYOUT}); EMIT_HOOK_EVENT("activeLayout", (std::vector<void*>{pKeyboard, (void*)&LAYOUT})); } |
