summaryrefslogtreecommitdiff
path: root/src/managers/InputManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-18 20:42:49 +0100
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-03-18 20:42:49 +0100
commit00098aef4f55eb53763e663bf470c7359da302a1 (patch)
treecfc0464f3aa578b7948e254d175b60ae5a808cbe /src/managers/InputManager.cpp
parentd086fa3faa219154c9f9d90a2d8958dcfd2ad393 (diff)
handle buttons
Diffstat (limited to 'src/managers/InputManager.cpp')
-rw-r--r--src/managers/InputManager.cpp26
1 files changed, 26 insertions, 0 deletions
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() {