From bc59b51dfaa9a2553c3d7d54984145e91552cc7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mon=20ou=C3=AFe?= Date: Thu, 30 Nov 2023 23:36:56 +0100 Subject: Allow SteamVR to send mouse move events to the window --- src/main.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 2559785..3cc827a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1475,6 +1475,11 @@ bool CMainApplication::HandleInput() window_resize_time = SDL_GetTicks(); window_resized = false; + if (overlay_mode) { + vr::HmdVector2_t scale = {(float)window_width, (float)window_height}; + vr::VROverlay()->SetOverlayMouseScale(overlay_handle, &scale); + } + if(focused_window_changed) { XSelectInput(x_display, src_window_id, StructureNotifyMask|VisibilityChangeMask|KeyPressMask|KeyReleaseMask); XFixesSelectCursorInput(x_display, src_window_id, XFixesDisplayCursorNotifyMask); @@ -1634,6 +1639,16 @@ void CMainApplication::ProcessVREvent( const vr::VREvent_t & event ) 12 * 1000); } break; + + case vr::VREvent_MouseMove: + if (overlay_xdo && src_window_id != None) { + xdo_move_mouse_relative_to_window( + overlay_xdo, src_window_id, + event.data.mouse.x, + event.data.mouse.y + ); + } + break; } } -- cgit v1.2.3