Skip to content

Commit

Permalink
Add gamepad binding, slim down knuckles binding, prevent viewfinder i…
Browse files Browse the repository at this point in the history
…n dashboard

Update EasyOpenVR
  • Loading branch information
BOLL7708 committed Jul 28, 2020
1 parent a818a4a commit 8c9f74b
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 99 deletions.
2 changes: 1 addition & 1 deletion SuperScreenShotterVR/EasyOpenVR
8 changes: 6 additions & 2 deletions SuperScreenShotterVR/MainController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion SuperScreenShotterVR/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion SuperScreenShotterVR/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,6 @@
<value>..\resources\logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Version" xml:space="preserve">
<value>v0.39</value>
<value>v0.40</value>
</data>
</root>
3 changes: 3 additions & 0 deletions SuperScreenShotterVR/SuperScreenShotterVR.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@
<None Include="app.vrmanifest">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="bindings_gamepad.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="bindings_knuckles.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
4 changes: 4 additions & 0 deletions SuperScreenShotterVR/actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
{
"controller_type": "knuckles",
"binding_url": "bindings_knuckles.json"
},
{
"controller_type": "gamepad",
"binding_url": "bindings_gamepad.json"
}
],
"actions": [
Expand Down
36 changes: 36 additions & 0 deletions SuperScreenShotterVR/bindings_gamepad.json
Original file line number Diff line number Diff line change
@@ -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" : []
}
96 changes: 2 additions & 94 deletions SuperScreenShotterVR/bindings_knuckles.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,125 +21,33 @@
}
],
"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"
}
]
}
},
"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" : []
}

0 comments on commit 8c9f74b

Please sign in to comment.