summaryrefslogtreecommitdiff
path: root/src/managers/input
diff options
context:
space:
mode:
Diffstat (limited to 'src/managers/input')
-rw-r--r--src/managers/input/InputManager.cpp19
-rw-r--r--src/managers/input/InputManager.hpp6
2 files changed, 5 insertions, 20 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);
}
diff --git a/src/managers/input/InputManager.hpp b/src/managers/input/InputManager.hpp
index 514d5bad..107d891f 100644
--- a/src/managers/input/InputManager.hpp
+++ b/src/managers/input/InputManager.hpp
@@ -76,6 +76,9 @@ public:
CTimer m_tmrLastCursorMovement;
+ // for shared mods
+ uint32_t accumulateModsFromAllKBs();
+
private:
// for click behavior override
@@ -92,9 +95,6 @@ private:
STabletTool* ensureTabletToolPresent(wlr_tablet_tool*);
void applyConfigToKeyboard(SKeyboard*);
-
- // for shared mods
- uint32_t accumulateModsFromAllKBs();
};
inline std::unique_ptr<CInputManager> g_pInputManager; \ No newline at end of file