diff options
author | Mon ouïe <mon.ouie@gmail.com> | 2023-11-30 23:36:56 +0100 |
---|---|---|
committer | Mon ouïe <mon.ouie@gmail.com> | 2023-11-30 23:36:56 +0100 |
commit | bc59b51dfaa9a2553c3d7d54984145e91552cc7e (patch) | |
tree | bb620160b0a5c67c8cbc19b4832d43ed33a4c209 /src | |
parent | 529f8625f58c23ce6118d4ae0dc6a5310f6d24a2 (diff) |
Allow SteamVR to send mouse move events to the window
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
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; } } |