From 5bb68d738a4a52681de8ebd87be8a37105289c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mon=20ou=C3=AFe?= Date: Fri, 1 Dec 2023 09:02:57 +0100 Subject: Allow scrubbing and pausing the video in the VR overlay --- src/main.cpp | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 7d526b8..109c1da 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1776,18 +1776,31 @@ void CMainApplication::ProcessVREvent( const vr::VREvent_t & event ) break; case vr::VREvent_MouseButtonDown: - if (overlay_xdo && src_window_id != None) { - xdo_mouse_down(overlay_xdo, src_window_id, - event.data.mouse.button); + if (overlay_xdo && (src_window_id != None || mpv_file)) { + if (mpv_file) + mpv.toggle_pause(); + else + xdo_mouse_down(overlay_xdo, src_window_id, + event.data.mouse.button); } break; case vr::VREvent_ScrollDiscrete: - if (overlay_xdo && src_window_id != None) { - if (event.data.scroll.ydelta > 0) - xdo_click_window(overlay_xdo, src_window_id, 4); - else if (event.data.scroll.ydelta < 0) - xdo_click_window(overlay_xdo, src_window_id, 5); + if (overlay_xdo && (src_window_id != None || mpv_file)) { + if (mpv_file) + { + if (event.data.scroll.ydelta > 0) + mpv.seek(-5.0); + else if (event.data.scroll.ydelta < 0) + mpv.seek(5.0); + } + else + { + if (event.data.scroll.ydelta > 0) + xdo_click_window(overlay_xdo, src_window_id, 4); + else if (event.data.scroll.ydelta < 0) + xdo_click_window(overlay_xdo, src_window_id, 5); + } } break; } -- cgit v1.2.3