From 00098aef4f55eb53763e663bf470c7359da302a1 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 18 Mar 2022 20:42:49 +0100 Subject: handle buttons --- src/managers/InputManager.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/managers/InputManager.cpp') diff --git a/src/managers/InputManager.cpp b/src/managers/InputManager.cpp index e2e88b9e..db5e049a 100644 --- a/src/managers/InputManager.cpp +++ b/src/managers/InputManager.cpp @@ -14,10 +14,36 @@ void CInputManager::onMouseMoved(wlr_event_pointer_motion* e) { wlr_cursor_move(g_pCompositor->m_sWLRCursor, e->device, delta.floor().x, delta.floor().y); } + + + if (e->time_msec) + wlr_idle_notify_activity(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sWLRSeat); + + // todo: focus + // todo: pointer } void CInputManager::onMouseWarp(wlr_event_pointer_motion_absolute* e) { wlr_cursor_warp_absolute(g_pCompositor->m_sWLRCursor, e->device, e->x, e->y); + + if (e->time_msec) + wlr_idle_notify_activity(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sWLRSeat); +} + +void CInputManager::onMouseButton(wlr_event_pointer_button* e) { + wlr_idle_notify_activity(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sWLRSeat); + + switch (e->state) { + case WLR_BUTTON_PRESSED: + // todo: keybinds + break; + case WLR_BUTTON_RELEASED: + // todo: keybinds + break; + } + + // notify app if we didnt handle it + wlr_seat_pointer_notify_button(g_pCompositor->m_sWLRSeat, e->time_msec, e->button, e->state); } Vector2D CInputManager::getMouseCoordsInternal() { -- cgit v1.2.3