diff options
Diffstat (limited to 'src/managers/InputManager.cpp')
| -rw-r--r-- | src/managers/InputManager.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/managers/InputManager.cpp b/src/managers/InputManager.cpp index db5e049a..5fb67b0a 100644 --- a/src/managers/InputManager.cpp +++ b/src/managers/InputManager.cpp @@ -19,7 +19,8 @@ void CInputManager::onMouseMoved(wlr_event_pointer_motion* e) { if (e->time_msec) wlr_idle_notify_activity(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sWLRSeat); - // todo: focus + + g_pCompositor->focusWindow(g_pCompositor->vectorToWindow(getMouseCoordsInternal())); // todo: pointer } @@ -74,6 +75,20 @@ void CInputManager::newKeyboard(wlr_input_device* keyboard) { wlr_seat_set_keyboard(g_pCompositor->m_sWLRSeat, keyboard); } +void CInputManager::newMouse(wlr_input_device* mouse) { + if (wlr_input_device_is_libinput(mouse)) { + const auto LIBINPUTDEV = (libinput_device*)wlr_libinput_get_device_handle(mouse); + + if (libinput_device_config_tap_get_finger_count(LIBINPUTDEV)) // this is for tapping (like on a laptop) + libinput_device_config_tap_set_enabled(LIBINPUTDEV, LIBINPUT_CONFIG_TAP_ENABLED); + + if (libinput_device_config_scroll_has_natural_scroll(LIBINPUTDEV)) + libinput_device_config_scroll_set_natural_scroll_enabled(LIBINPUTDEV, 0 /* Natural */); + } + + wlr_cursor_attach_input_device(g_pCompositor->m_sWLRCursor, mouse); +} + void CInputManager::onKeyboardKey(wlr_event_keyboard_key* event) { } |
