From 56576fd3dde52b2c8acdfbdf4675be26f90a9c84 Mon Sep 17 00:00:00 2001 From: chaixshot Date: Thu, 7 May 2026 18:08:10 +0700 Subject: [PATCH 1/6] fix headset return 0 and capture sound --- SuperScreenShotterVR/MainController.cs | 34 ++++++++++++-------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/SuperScreenShotterVR/MainController.cs b/SuperScreenShotterVR/MainController.cs index ba47e54..6b4ebcd 100644 --- a/SuperScreenShotterVR/MainController.cs +++ b/SuperScreenShotterVR/MainController.cs @@ -6,9 +6,9 @@ using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.IO; +using System.Media; using System.Runtime.Versioning; using System.Threading; -using System.Windows.Media; using System.Windows.Media.Imaging; using Valve.VR; using static EasyOpenVR.EasyOpenVRSingleton; @@ -34,7 +34,7 @@ public class MainController private Dictionary _screenshotQueue = new Dictionary(); private uint _lastScreenshotHandle = 0; private bool _shouldShutDown = false; - private MediaPlayer? _mediaPlayer; + private SoundPlayer? _mediaPlayer; private string _currentAudio = string.Empty; private Stopwatch _stopWatch = new Stopwatch(); @@ -51,7 +51,7 @@ public class MainController private OverlayTextureSize _reticleTextureSize = new OverlayTextureSize(); private float _displayFrequency = 90f; // Used for how often we should move the overlay to react to the headset. private bool _overlayIsVisible = false; - private float _screenshotFoV = 0; + private float _screenshotFoV = 100; private SuperServer _server = new SuperServer(); @@ -65,7 +65,7 @@ public void Init() StatusUpdateAction.Invoke(false); AppUpdateAction.Invoke(""); - _mediaPlayer = new MediaPlayer(); + _mediaPlayer = new SoundPlayer(); _workerThread = new Thread(WorkerThread); _workerThread.Start(); @@ -288,8 +288,10 @@ private void UpdateDisplayFrequency() private void UpdateTrackedDeviceIndex() { var indexes = _ovr.GetIndexesForTrackedDeviceClass(ETrackedDeviceClass.HMD); + float fov = _ovr.GetFloatTrackedDeviceProperty(_trackedDeviceIndex, ETrackedDeviceProperty.Prop_ScreenshotHorizontalFieldOfViewDegrees_Float); + if (indexes.Length > 0) _trackedDeviceIndex = indexes[0]; - _screenshotFoV = _ovr.GetFloatTrackedDeviceProperty(_trackedDeviceIndex, ETrackedDeviceProperty.Prop_ScreenshotHorizontalFieldOfViewDegrees_Float); + if (fov > 0) _screenshotFoV = fov; } private void ToggleViewfinder(bool visible) @@ -461,23 +463,19 @@ private void ShutdownIfWeShould() private void PlayScreenshotSound(bool onlyLoad = false) { - _mediaPlayer ??= new MediaPlayer(); - _mediaPlayer.Dispatcher.Invoke(() => // Always execute tasks on the media player on the thread it was initiated. + _mediaPlayer ??= new SoundPlayer(); + if (_currentAudio != _settings.CustomAudio) { - if (_currentAudio != _settings.CustomAudio) + _currentAudio = _settings.CustomAudio; + if (_currentAudio != string.Empty && File.Exists(_currentAudio)) { - _currentAudio = _settings.CustomAudio; - if (_currentAudio != string.Empty && File.Exists(_currentAudio)) - { - _mediaPlayer.Open(new Uri(_currentAudio)); - } + _mediaPlayer.SoundLocation = _currentAudio; } + } - if (onlyLoad) return true; - _mediaPlayer.Stop(); - _mediaPlayer.Play(); - return true; - }); + if (onlyLoad) return; + _mediaPlayer.Stop(); + _mediaPlayer.Play(); } private class ScreenshotData { From 876df89fe221a512504e6dee1de10d31fda35ff4 Mon Sep 17 00:00:00 2001 From: chaixshot Date: Thu, 7 May 2026 18:16:59 +0700 Subject: [PATCH 2/6] fix TakeDelayedScreenshot() view finder thread frozen --- SuperScreenShotterVR/MainController.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SuperScreenShotterVR/MainController.cs b/SuperScreenShotterVR/MainController.cs index 6b4ebcd..91a4345 100644 --- a/SuperScreenShotterVR/MainController.cs +++ b/SuperScreenShotterVR/MainController.cs @@ -527,8 +527,12 @@ private void TakeDelayedScreenshot(bool shouldTrigger = true, ScreenshotMessage { delay = screenshotMessage.Delay; } - Thread.Sleep(delay * 1000); - TakeScreenshot(true, screenshotMessage); // byUser set to true as time-lapse does not use delayed shots + + System.Threading.Tasks.Task.Run(async () => + { + Thread.Sleep(delay * 1000); + TakeScreenshot(true, screenshotMessage); // byUser set to true as time-lapse does not use delayed shots + }); } private void ScreenShotTaken(VREvent_Data_t eventData) From e3dc88fb71f0869e383bfc0534444f344c1b60b3 Mon Sep 17 00:00:00 2001 From: chaixshot Date: Thu, 7 May 2026 18:29:50 +0700 Subject: [PATCH 3/6] added bindings_oculus_touch.json --- SuperScreenShotterVR/actions.json | 4 ++ .../bindings_oculus_touch.json | 65 +++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 SuperScreenShotterVR/bindings_oculus_touch.json diff --git a/SuperScreenShotterVR/actions.json b/SuperScreenShotterVR/actions.json index b0e17ae..e2d32fa 100644 --- a/SuperScreenShotterVR/actions.json +++ b/SuperScreenShotterVR/actions.json @@ -4,6 +4,10 @@ "controller_type": "knuckles", "binding_url": "bindings_knuckles.json" }, + { + "controller_type": "oculus_touch", + "binding_url": "bindings_oculus_touch.json" + }, { "controller_type": "gamepad", "binding_url": "bindings_gamepad.json" diff --git a/SuperScreenShotterVR/bindings_oculus_touch.json b/SuperScreenShotterVR/bindings_oculus_touch.json new file mode 100644 index 0000000..13b72d1 --- /dev/null +++ b/SuperScreenShotterVR/bindings_oculus_touch.json @@ -0,0 +1,65 @@ +{ + "action_manifest_version": 0, + "alias_info": {}, + "app_key": "boll7708.superscreenshottervr", + "bindings": { + "/actions/screenshots": { + "chords": [ + { + "inputs": [ + [ "/user/hand/left/input/system", "touch" ] + ], + "output": "/actions/screenshots/in/show_viewfinder" + }, + { + "inputs": [ + [ "/user/hand/left/input/system", "touch" ], + [ "/user/hand/left/input/trigger", "click" ] + ], + "output": "/actions/screenshots/in/take_screenshot" + }, + { + "inputs": [ + [ "/user/hand/right/input/system", "touch" ] + ], + "output": "/actions/screenshots/in/show_viewfinder" + }, + { + "inputs": [ + [ "/user/hand/right/input/system", "touch" ], + [ "/user/hand/right/input/trigger", "click" ] + ], + "output": "/actions/screenshots/in/take_screenshot" + } + ], + "sources": [ + { + "inputs": {}, + "mode": "button", + "path": "/user/hand/left/input/trigger" + }, + { + "inputs": {}, + "mode": "button", + "path": "/user/hand/right/input/trigger" + }, + { + "inputs": {}, + "mode": "button", + "path": "/user/hand/left/input/system" + }, + { + "inputs": {}, + "mode": "button", + "path": "/user/hand/right/input/system" + } + ] + } + }, + "category": "steamvr_input", + "controller_type": "oculus_touch", + "description": "Default Oculus Touch Bindings", + "name": "Default SuperScreenShotterVR configuration for Index Controller", + "options": {}, + "simulated_actions": [] +} From 27c0a38ad0aeb08e604e6b51736916f550c05647 Mon Sep 17 00:00:00 2001 From: chaixshot Date: Thu, 7 May 2026 18:41:16 +0700 Subject: [PATCH 4/6] cleanup missing part --- SuperScreenShotterVR/SuperScreenShotterVR.csproj | 3 +++ SuperScreenShotterVR/bindings_oculus_touch.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/SuperScreenShotterVR/SuperScreenShotterVR.csproj b/SuperScreenShotterVR/SuperScreenShotterVR.csproj index 47f89c5..2eb41e3 100644 --- a/SuperScreenShotterVR/SuperScreenShotterVR.csproj +++ b/SuperScreenShotterVR/SuperScreenShotterVR.csproj @@ -36,6 +36,9 @@ Always + + Always + diff --git a/SuperScreenShotterVR/bindings_oculus_touch.json b/SuperScreenShotterVR/bindings_oculus_touch.json index 13b72d1..329908f 100644 --- a/SuperScreenShotterVR/bindings_oculus_touch.json +++ b/SuperScreenShotterVR/bindings_oculus_touch.json @@ -59,7 +59,7 @@ "category": "steamvr_input", "controller_type": "oculus_touch", "description": "Default Oculus Touch Bindings", - "name": "Default SuperScreenShotterVR configuration for Index Controller", + "name": "Default SuperScreenShotterVR configuration for Oculus Touch", "options": {}, "simulated_actions": [] } From 9358c0b8c4109eff6fb76dae0c6c57f3ba5cba51 Mon Sep 17 00:00:00 2001 From: chaixshot Date: Thu, 7 May 2026 18:44:54 +0700 Subject: [PATCH 5/6] Signing CLA --- CLA.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CLA.md b/CLA.md index fdcd8c4..5b2bdbb 100644 --- a/CLA.md +++ b/CLA.md @@ -18,3 +18,4 @@ By adding your GitHub username to the list below, you agree to the following: Add your GitHub username as a new entry at the end of the list. Do not alter other entries, and leave one blank line below yours. - BOLL7708 +- chaixshot From 753041827f8bd6226dd1b608b19608ec166e162d Mon Sep 17 00:00:00 2001 From: chaixshot Date: Fri, 8 May 2026 13:44:19 +0700 Subject: [PATCH 6/6] fix delay screenshot toggle on viewfinder even when no running app --- SuperScreenShotterVR/MainController.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SuperScreenShotterVR/MainController.cs b/SuperScreenShotterVR/MainController.cs index 91a4345..45c0bee 100644 --- a/SuperScreenShotterVR/MainController.cs +++ b/SuperScreenShotterVR/MainController.cs @@ -520,7 +520,8 @@ private uint TakeScreenshot(bool byUser = true, ScreenshotMessage? screenshotMes private void TakeDelayedScreenshot(bool shouldTrigger = true, ScreenshotMessage screenshotMessage = null) { if (!shouldTrigger) return; - + if (_currentAppId.Equals(string.Empty)) return; // There needs to be a running application + ToggleViewfinder(true); var delay = _settings.DelaySeconds; if(screenshotMessage != null && screenshotMessage.Delay > 0)