aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMon ouïe <mon.ouie@gmail.com>2023-12-01 09:02:57 +0100
committerMon ouïe <mon.ouie@gmail.com>2023-12-01 09:02:57 +0100
commit5bb68d738a4a52681de8ebd87be8a37105289c4e (patch)
treea5208efe4a42a9f58caab28fc78278bbddbbe0ba /src
parent2860c7ce09fbf2c30ce4bc48df3fce708e734339 (diff)
Allow scrubbing and pausing the video in the VR overlay
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp29
1 files changed, 21 insertions, 8 deletions
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;
}