aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMon ouïe <mon.ouie@gmail.com>2023-12-01 05:53:24 +0100
committerMon ouïe <mon.ouie@gmail.com>2023-12-01 05:53:24 +0100
commite8253dcaa4dfdfefea3db112c300104afe7ce42b (patch)
tree77d93035d3007009f3caea264556e6badaa75540 /src
parentbaa904389de9331ffd12eb33a4f30b1c809cfbe6 (diff)
Add a command line flag to disable mouse controls for VR overlays
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 884a282..cf0ce8e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -420,6 +420,7 @@ private: // X compositor
const char *overlay_key = "vr-video-player";
xdo_t *overlay_xdo = nullptr;
Atom overlay_icon_atom;
+ bool overlay_mouse_controls = true;
};
@@ -717,6 +718,8 @@ CMainApplication::CMainApplication( int argc, char *argv[] )
} else if(strcmp(argv[i], "--overlay-key") == 0 && i < argc - 1) {
overlay_key = argv[i + 1];
++i;
+ } else if(strcmp(argv[i], "--no-overlay-mouse") == 0) {
+ overlay_mouse_controls = false;
}
else if(argv[i][0] == '-') {
fprintf(stderr, "Invalid flag: %s\n", argv[i]);
@@ -1193,7 +1196,10 @@ bool CMainApplication::BInitOverlay()
&thumbnail_handle
);
- vr::VROverlay()->SetOverlayInputMethod(overlay_handle, vr::VROverlayInputMethod_Mouse);
+ if (overlay_mouse_controls)
+ vr::VROverlay()->SetOverlayInputMethod(overlay_handle, vr::VROverlayInputMethod_Mouse);
+ else
+ vr::VROverlay()->SetOverlayInputMethod(overlay_handle, vr::VROverlayInputMethod_None);
vr::VROverlay()->SetOverlayFlag(overlay_handle, vr::VROverlayFlags_IgnoreTextureAlpha, true);
vr::VROverlay()->SetOverlayFlag(overlay_handle, vr::VROverlayFlags_EnableControlBar, true);