diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-07-20 22:45:06 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-07-20 22:45:06 +0200 |
| commit | fa2bd3b1a846e7395f96b3bd3587a5ef92ed30be (patch) | |
| tree | 14d226025b60599c09bc7d7bc63bef2e1c16460b /src/managers/input/InputManager.cpp | |
| parent | fc33cae70cab2c5acaeac77e8a5c2594c7292bbd (diff) | |
added keybinds on key up
Diffstat (limited to 'src/managers/input/InputManager.cpp')
| -rw-r--r-- | src/managers/input/InputManager.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index f1ef0a91..c922421c 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -629,26 +629,11 @@ void CInputManager::destroyMouse(wlr_input_device* mouse) { } void CInputManager::onKeyboardKey(wlr_keyboard_key_event* e, SKeyboard* pKeyboard) { - const auto KEYCODE = e->keycode + 8; // Because to xkbcommon it's +8 from libinput - - const xkb_keysym_t* keysyms; - int syms = xkb_state_key_get_syms(wlr_keyboard_from_input_device(pKeyboard->keyboard)->xkb_state, KEYCODE, &keysyms); - - const auto MODS = accumulateModsFromAllKBs(); + bool passEvent = g_pKeybindManager->onKeyEvent(e, pKeyboard); wlr_idle_notify_activity(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat); - bool found = false; - if (e->state == WL_KEYBOARD_KEY_STATE_PRESSED) { - for (int i = 0; i < syms; ++i) - found = g_pKeybindManager->handleKeybinds(MODS, keysyms[i], 0) || found; - - found = g_pKeybindManager->handleKeybinds(MODS, 0, KEYCODE) || found; - } else if (e->state == WL_KEYBOARD_KEY_STATE_RELEASED) { - // hee hee - } - - if (!found) { + if (passEvent) { wlr_seat_set_keyboard(g_pCompositor->m_sSeat.seat, wlr_keyboard_from_input_device(pKeyboard->keyboard)); wlr_seat_keyboard_notify_key(g_pCompositor->m_sSeat.seat, e->time_msec, e->keycode, e->state); } |
