From 8c9f74b066eb0569cc595556ac6e250904ff8a58 Mon Sep 17 00:00:00 2001 From: Andreas Aronsson Date: Tue, 28 Jul 2020 18:55:03 +0200 Subject: [PATCH] Add gamepad binding, slim down knuckles binding, prevent viewfinder in dashboard Update EasyOpenVR --- SuperScreenShotterVR/EasyOpenVR | 2 +- SuperScreenShotterVR/MainController.cs | 8 +- .../Properties/Resources.Designer.cs | 2 +- .../Properties/Resources.resx | 2 +- .../SuperScreenShotterVR.csproj | 3 + SuperScreenShotterVR/actions.json | 4 + SuperScreenShotterVR/bindings_gamepad.json | 36 +++++++ SuperScreenShotterVR/bindings_knuckles.json | 96 +------------------ 8 files changed, 54 insertions(+), 99 deletions(-) create mode 100644 SuperScreenShotterVR/bindings_gamepad.json diff --git a/SuperScreenShotterVR/EasyOpenVR b/SuperScreenShotterVR/EasyOpenVR index 8802119..6579749 160000 --- a/SuperScreenShotterVR/EasyOpenVR +++ b/SuperScreenShotterVR/EasyOpenVR @@ -1 +1 @@ -Subproject commit 8802119615e564f6c13e89c1b04466ee5fe40705 +Subproject commit 6579749bd18ff18456a940bf956350141c021481 diff --git a/SuperScreenShotterVR/MainController.cs b/SuperScreenShotterVR/MainController.cs index 9cfdb60..2ad2e12 100644 --- a/SuperScreenShotterVR/MainController.cs +++ b/SuperScreenShotterVR/MainController.cs @@ -104,11 +104,11 @@ private void WorkerThread() // TODO: After restart these do not get registered again??!!?? _ovr.RegisterDigitalAction( "/actions/screenshots/in/take_screenshot", - (data, handle) => { if (data.bState) ScreenshotTriggered(); } + (data, handle) => { if (data.bState && !OpenVR.Overlay.IsDashboardVisible()) ScreenshotTriggered(); } ); _ovr.RegisterDigitalAction( "/actions/screenshots/in/show_viewfinder", - (data, handle) => { ToggleViewfinder(data.bState); } + (data, handle) => { ToggleViewfinder(data.bState && !OpenVR.Overlay.IsDashboardVisible()); } ); _notificationOverlayHandle = _ovr.InitNotificationOverlay("SuperScreenShotterVR"); _currentAppId = _ovr.GetRunningApplicationId(); @@ -160,6 +160,10 @@ private void WorkerThread() // (as well as other settings) UpdateDisplayFrequency(); }); + _ovr.RegisterEvent(EVREventType.VREvent_DashboardActivated, (data) => + { + ToggleViewfinder(false); + }); Debug.WriteLine("Init complete."); } else diff --git a/SuperScreenShotterVR/Properties/Resources.Designer.cs b/SuperScreenShotterVR/Properties/Resources.Designer.cs index fec4c3c..1040906 100644 --- a/SuperScreenShotterVR/Properties/Resources.Designer.cs +++ b/SuperScreenShotterVR/Properties/Resources.Designer.cs @@ -90,7 +90,7 @@ internal static System.Drawing.Bitmap logo { } /// - /// Looks up a localized string similar to v0.39. + /// Looks up a localized string similar to v0.40. /// internal static string Version { get { diff --git a/SuperScreenShotterVR/Properties/Resources.resx b/SuperScreenShotterVR/Properties/Resources.resx index eed5392..3ab241a 100644 --- a/SuperScreenShotterVR/Properties/Resources.resx +++ b/SuperScreenShotterVR/Properties/Resources.resx @@ -128,6 +128,6 @@ ..\resources\logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - v0.39 + v0.40 \ No newline at end of file diff --git a/SuperScreenShotterVR/SuperScreenShotterVR.csproj b/SuperScreenShotterVR/SuperScreenShotterVR.csproj index c6fb0bb..c6043d7 100644 --- a/SuperScreenShotterVR/SuperScreenShotterVR.csproj +++ b/SuperScreenShotterVR/SuperScreenShotterVR.csproj @@ -126,6 +126,9 @@ Always + + Always + Always diff --git a/SuperScreenShotterVR/actions.json b/SuperScreenShotterVR/actions.json index 298c756..9a0bde4 100644 --- a/SuperScreenShotterVR/actions.json +++ b/SuperScreenShotterVR/actions.json @@ -3,6 +3,10 @@ { "controller_type": "knuckles", "binding_url": "bindings_knuckles.json" + }, + { + "controller_type": "gamepad", + "binding_url": "bindings_gamepad.json" } ], "actions": [ diff --git a/SuperScreenShotterVR/bindings_gamepad.json b/SuperScreenShotterVR/bindings_gamepad.json new file mode 100644 index 0000000..2cb19b8 --- /dev/null +++ b/SuperScreenShotterVR/bindings_gamepad.json @@ -0,0 +1,36 @@ +{ + "action_manifest_version" : 0, + "alias_info" : {}, + "app_key" : "boll7708.superscreenshottervr", + "bindings" : { + "/actions/screenshots" : { + "chords" : [ + { + "inputs" : [ + [ "/user/gamepad/input/start", "click" ], + [ "/user/gamepad/input/back", "click" ] + ], + "output" : "/actions/screenshots/in/take_screenshot" + } + ], + "sources" : [ + { + "inputs" : {}, + "mode" : "button", + "path" : "/user/gamepad/input/start" + }, + { + "inputs" : {}, + "mode" : "button", + "path" : "/user/gamepad/input/back" + } + ] + } + }, + "category" : "steamvr_input", + "controller_type" : "gamepad", + "description" : "Default Gamepad Bindings", + "name" : "Default SuperScreenShotterVR configuration for Gamepad", + "options" : {}, + "simulated_actions" : [] +} diff --git a/SuperScreenShotterVR/bindings_knuckles.json b/SuperScreenShotterVR/bindings_knuckles.json index c73cc2f..3391780 100644 --- a/SuperScreenShotterVR/bindings_knuckles.json +++ b/SuperScreenShotterVR/bindings_knuckles.json @@ -21,117 +21,25 @@ } ], "sources" : [ - { - "inputs" : {}, - "mode" : "button", - "path" : "/user/hand/left/input/b" - }, { "inputs" : {}, "mode" : "button", "path" : "/user/hand/left/input/trigger" }, - { - "inputs" : {}, - "mode" : "button", - "path" : "/user/hand/right/input/b" - }, { "inputs" : {}, "mode" : "button", "path" : "/user/hand/right/input/trigger" }, - { - "inputs" : {}, - "mode" : "button", - "path" : "/user/hand/right/input/a" - }, - { - "inputs" : {}, - "mode" : "button", - "path" : "/user/hand/left/input/a" - }, - { + { "inputs" : {}, "mode" : "button", "path" : "/user/hand/left/input/system" }, - { - "inputs" : {}, - "mode" : "button", - "path" : "/user/hand/left/input/trackpad" - }, - { - "inputs" : {}, - "mode" : "dpad", - "parameters" : { - "sub_mode" : "click" - }, - "path" : "/user/hand/left/input/trackpad" - }, - { - "inputs" : {}, - "mode" : "button", - "path" : "/user/hand/left/input/thumbstick" - }, - { - "inputs" : {}, - "mode" : "dpad", - "parameters" : { - "sub_mode" : "touch" - }, - "path" : "/user/hand/left/input/thumbstick" - }, - { - "inputs" : {}, - "mode" : "grab", - "path" : "/user/hand/left/input/grip" - }, - { - "inputs" : {}, - "mode" : "grab", - "path" : "/user/hand/left/input/pinch" - }, { "inputs" : {}, "mode" : "button", "path" : "/user/hand/right/input/system" - }, - { - "inputs" : {}, - "mode" : "button", - "path" : "/user/hand/right/input/trackpad" - }, - { - "inputs" : {}, - "mode" : "dpad", - "parameters" : { - "sub_mode" : "click" - }, - "path" : "/user/hand/right/input/trackpad" - }, - { - "inputs" : {}, - "mode" : "button", - "path" : "/user/hand/right/input/thumbstick" - }, - { - "inputs" : {}, - "mode" : "dpad", - "parameters" : { - "sub_mode" : "touch" - }, - "path" : "/user/hand/right/input/thumbstick" - }, - { - "inputs" : {}, - "mode" : "grab", - "path" : "/user/hand/right/input/grip" - }, - { - "inputs" : {}, - "mode" : "grab", - "path" : "/user/hand/right/input/pinch" } ] } @@ -139,7 +47,7 @@ "category" : "steamvr_input", "controller_type" : "knuckles", "description" : "Default Index Controller Bindings", - "name" : "SuperScreenShotterVR configuration for Index Controller", + "name" : "Default SuperScreenShotterVR configuration for Index Controller", "options" : {}, "simulated_actions" : [] }