input basics
This commit is contained in:
parent
52090853da
commit
cf51ab71a2
17 changed files with 459 additions and 19 deletions
17
src/input/InputManager.cpp
Normal file
17
src/input/InputManager.cpp
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#include "InputManager.hpp"
|
||||
#include "../Compositor.hpp"
|
||||
|
||||
void CInputManager::onMouseMoved(wlr_event_pointer_motion* e) {
|
||||
// TODO: sensitivity
|
||||
|
||||
float sensitivity = 0.25f;
|
||||
|
||||
m_vMouseCoords = m_vMouseCoords + Vector2D(e->delta_x * sensitivity, e->delta_y * sensitivity);
|
||||
|
||||
if (m_vMouseCoords.floor() != m_vWLRMouseCoords) {
|
||||
Vector2D delta = m_vMouseCoords - m_vWLRMouseCoords;
|
||||
m_vWLRMouseCoords = m_vMouseCoords.floor();
|
||||
|
||||
wlr_cursor_move(g_pCompositor->m_sWLRCursor, e->device, delta.floor().x, delta.floor().y);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue