focus and move mouse to inputmanager

This commit is contained in:
vaxerski
2022-03-18 22:53:27 +01:00
parent a1a8f3b6d5
commit 5811d968bf
5 changed files with 64 additions and 2 deletions

View File

@@ -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) {
}