mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-05 20:45:59 +01:00
17 lines
556 B
C++
17 lines
556 B
C++
|
#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);
|
||
|
}
|
||
|
}
|