From 0798ad240edffc5c31858cdffd5b4dd12d665d0f Mon Sep 17 00:00:00 2001 From: LivingFray Date: Sat, 24 Dec 2022 17:07:49 +0000 Subject: [PATCH] Fixed valve index support? --- .gitignore | 3 +- .../SteamVR_Standalone/actions.json | 4 + .../SteamVR_Standalone/bindings_knuckles.json | 651 ++++++++++++++++++ SteamVR_IL2CPP/Scripts/SteamVR.cs | 5 +- 4 files changed, 661 insertions(+), 2 deletions(-) create mode 100644 Dependencies/Metal_Data/StreamingAssets/SteamVR_Standalone/bindings_knuckles.json diff --git a/.gitignore b/.gitignore index 9491a2f..01a239a 100644 --- a/.gitignore +++ b/.gitignore @@ -360,4 +360,5 @@ MigrationBackup/ .ionide/ # Fody - auto-generated XML schema -FodyWeavers.xsd \ No newline at end of file +FodyWeavers.xsd +/_Release diff --git a/Dependencies/Metal_Data/StreamingAssets/SteamVR_Standalone/actions.json b/Dependencies/Metal_Data/StreamingAssets/SteamVR_Standalone/actions.json index 9863ab9..128f222 100644 --- a/Dependencies/Metal_Data/StreamingAssets/SteamVR_Standalone/actions.json +++ b/Dependencies/Metal_Data/StreamingAssets/SteamVR_Standalone/actions.json @@ -113,6 +113,10 @@ { "controller_type": "oculus_touch", "binding_url": "bindings_oculus_touch.json" + }, + { + "controller_type": "knuckles", + "binding_url": "bindings_knuckles.json" } ], "localization": [ diff --git a/Dependencies/Metal_Data/StreamingAssets/SteamVR_Standalone/bindings_knuckles.json b/Dependencies/Metal_Data/StreamingAssets/SteamVR_Standalone/bindings_knuckles.json new file mode 100644 index 0000000..98eb948 --- /dev/null +++ b/Dependencies/Metal_Data/StreamingAssets/SteamVR_Standalone/bindings_knuckles.json @@ -0,0 +1,651 @@ +{ + "/actions/legacy": { + "poses": [ + { + "output": "/actions/legacy/in/Left_Pose", + "path": "/user/hand/left/pose/raw" + }, + { + "output": "/actions/legacy/in/Right_Pose", + "path": "/user/hand/right/pose/raw" + } + ], + "haptics": [ + { + "output": "/actions/legacy/out/left_haptic", + "path": "/user/hand/left/output/haptic" + }, + { + "output": "/actions/legacy/out/right_haptic", + "path": "/user/hand/right/output/haptic" + } + ], + "sources": [ + { + "path": "/user/hand/left/input/system", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/legacy/in/left_system_press" + } + } + }, + { + "path": "/user/hand/left/input/trigger", + "mode": "trigger", + "inputs": { + "pull": { + "output": "/actions/legacy/in/left_axis1_value" + }, + "touch": { + "output": "/actions/legacy/in/left_axis1_touch" + } + } + }, + { + "path": "/user/hand/right/input/system", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/legacy/in/right_system_press" + } + } + }, + { + "path": "/user/hand/right/input/a", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/legacy/in/right_grip_press" + }, + "touch": { + "output": "/actions/legacy/in/right_grip_touch" + } + } + }, + { + "path": "/user/hand/left/input/a", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/legacy/in/left_grip_press" + }, + "touch": { + "output": "/actions/legacy/in/left_grip_touch" + } + } + }, + { + "path": "/user/hand/left/input/b", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/legacy/in/left_applicationmenu_press" + }, + "touch": { + "output": "/actions/legacy/in/left_applicationmenu_touch" + } + } + }, + { + "path": "/user/hand/right/input/b", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/legacy/in/right_applicationmenu_press" + }, + "touch": { + "output": "/actions/legacy/in/right_applicationmenu_touch" + } + } + }, + { + "path": "/user/hand/left/input/trackpad", + "mode": "trackpad", + "inputs": { + "click": { + "output": "/actions/legacy/in/left_axis0_press" + }, + "position": { + "output": "/actions/legacy/in/left_axis0_value" + }, + "touch": { + "output": "/actions/legacy/in/left_axis0_touch" + } + } + }, + { + "path": "/user/hand/right/input/trackpad", + "mode": "trackpad", + "inputs": { + "click": { + "output": "/actions/legacy/in/right_axis0_press" + }, + "position": { + "output": "/actions/legacy/in/right_axis0_value" + }, + "touch": { + "output": "/actions/legacy/in/right_axis0_touch" + } + } + }, + { + "path": "/user/hand/right/input/trigger", + "mode": "trigger", + "inputs": { + "pull": { + "output": "/actions/legacy/in/right_axis1_value" + }, + "touch": { + "output": "/actions/legacy/in/right_axis1_touch" + } + } + }, + { + "path": "/user/hand/left/input/trigger", + "mode": "button", + "parameters": { + "click_activate_threshold": "0.55", + "click_deactivate_threshold": "0.5", + "haptic_amplitude": "0", + "touch_activate_threshold": "0.1", + "touch_deactivate_threshold": "0.05" + }, + "inputs": { + "click": { + "output": "/actions/legacy/in/left_axis1_press" + }, + "touch": { + "output": "/actions/legacy/in/left_axis1_touch" + } + } + }, + { + "path": "/user/hand/right/input/trigger", + "mode": "button", + "parameters": { + "click_activate_threshold": "0.55", + "click_deactivate_threshold": "0.5", + "haptic_amplitude": "0", + "touch_activate_threshold": "0.1", + "touch_deactivate_threshold": "0.05" + }, + "inputs": { + "click": { + "output": "/actions/legacy/in/right_axis1_press" + }, + "touch": { + "output": "/actions/legacy/in/right_axis1_touch" + } + } + }, + { + "path": "/user/hand/left/input/trackpad", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/legacy/in/left_axis0_press" + } + } + }, + { + "path": "/user/hand/right/input/trackpad", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/legacy/in/right_axis0_press" + } + } + }, + { + "path": "/user/hand/left/input/thumbstick", + "mode": "joystick", + "inputs": { + "click": { + "output": "/actions/legacy/in/left_axis0_press" + }, + "position": { + "output": "/actions/legacy/in/left_axis0_value" + }, + "touch": { + "output": "/actions/legacy/in/left_axis0_touch" + } + } + }, + { + "path": "/user/hand/right/input/thumbstick", + "mode": "joystick", + "inputs": { + "click": { + "output": "/actions/legacy/in/right_axis0_press" + }, + "position": { + "output": "/actions/legacy/in/right_axis0_value" + }, + "touch": { + "output": "/actions/legacy/in/right_axis0_touch" + } + } + }, + { + "path": "/user/hand/left/input/thumbstick", + "mode": "button", + "parameters": { + "click_activate_threshold": 0.8, + "click_deactivate_threshold": 0.7, + "force_input": "position", + "haptic_amplitude": 0 + }, + "inputs": { + "click": { + "output": "/actions/legacy/in/left_axis0_press" + } + } + }, + { + "path": "/user/hand/right/input/thumbstick", + "mode": "button", + "parameters": { + "click_activate_threshold": 0.8, + "click_deactivate_threshold": 0.7, + "force_input": "position", + "haptic_amplitude": 0 + }, + "inputs": { + "click": { + "output": "/actions/legacy/in/right_axis0_press" + } + } + }, + { + "path": "/user/hand/left/input/grip", + "mode": "button", + "parameters": { + "click_activate_threshold": "0.8", + "force_input": "force" + }, + "inputs": { + "click": { + "output": "/actions/legacy/in/left_grip_press" + }, + "touch": { + "output": "/actions/legacy/in/left_grip_touch" + } + } + }, + { + "path": "/user/hand/right/input/grip", + "mode": "button", + "parameters": { + "click_activate_threshold": "0.8", + "force_input": "force" + }, + "inputs": { + "click": { + "output": "/actions/legacy/in/right_grip_press" + }, + "touch": { + "output": "/actions/legacy/in/right_grip_touch" + } + } + } + ] + }, + "/actions/legacy_mirrored": { + "poses": [ + { + "output": "/actions/legacy_mirrored/in/pose", + "path": "/user/hand/left/pose/raw" + }, + { + "output": "/actions/legacy_mirrored/in/pose", + "path": "/user/hand/right/pose/raw" + } + ], + "haptics": [ + { + "output": "/actions/legacy_mirrored/out/haptic", + "path": "/user/hand/left/output/haptic" + }, + { + "output": "/actions/legacy_mirrored/out/haptic", + "path": "/user/hand/right/output/haptic" + } + ], + "sources": [ + { + "path": "/user/hand/left/input/trigger", + "mode": "trigger", + "inputs": { + "click": { + "output": "/actions/legacy_mirrored/in/axis1_press" + }, + "pull": { + "output": "/actions/legacy_mirrored/in/axis1_value" + }, + "touch": { + "output": "/actions/legacy_mirrored/in/axis1_touch" + } + } + }, + { + "path": "/user/hand/right/input/trigger", + "mode": "trigger", + "inputs": { + "click": { + "output": "/actions/legacy_mirrored/in/axis1_press" + }, + "pull": { + "output": "/actions/legacy_mirrored/in/axis1_value" + }, + "touch": { + "output": "/actions/legacy_mirrored/in/axis1_touch" + } + } + }, + { + "path": "/user/hand/left/input/trackpad", + "mode": "trackpad", + "inputs": { + "position": { + "output": "/actions/legacy_mirrored/in/axis0_value" + }, + "touch": { + "output": "/actions/legacy_mirrored/in/axis0_touch" + } + } + }, + { + "path": "/user/hand/right/input/trackpad", + "mode": "trackpad", + "inputs": { + "position": { + "output": "/actions/legacy_mirrored/in/axis0_value" + }, + "touch": { + "output": "/actions/legacy_mirrored/in/axis0_touch" + } + } + }, + { + "path": "/user/hand/left/input/thumbstick", + "mode": "joystick", + "inputs": {} + }, + { + "path": "/user/hand/right/input/thumbstick", + "mode": "joystick", + "inputs": {} + }, + { + "path": "/user/hand/left/input/a", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/legacy_mirrored/in/grip_press" + }, + "touch": { + "output": "/actions/legacy_mirrored/in/grip_touch" + } + } + }, + { + "path": "/user/hand/right/input/a", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/legacy_mirrored/in/grip_press" + }, + "touch": { + "output": "/actions/legacy_mirrored/in/grip_touch" + } + } + }, + { + "path": "/user/hand/left/input/b", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/legacy_mirrored/in/applicationmenu_press" + }, + "touch": { + "output": "/actions/legacy_mirrored/in/applicationmenu_touch" + } + } + }, + { + "path": "/user/hand/right/input/b", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/legacy_mirrored/in/applicationmenu_press" + }, + "touch": { + "output": "/actions/legacy_mirrored/in/applicationmenu_touch" + } + } + }, + { + "path": "/user/hand/left/input/trackpad", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/legacy_mirrored/in/axis0_press" + } + } + }, + { + "path": "/user/hand/right/input/trackpad", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/legacy_mirrored/in/axis0_press" + } + } + } + ] + }, + "/actions/game": { + "poses": [ + { + "path": "/user/hand/left/pose/raw", + "output": "/actions/game/in/pose" + }, + { + "path": "/user/hand/right/pose/raw", + "output": "/actions/game/in/pose" + }, + { + "path": "/user/hand/left/pose/tip", + "output": "/actions/game/in/posetip" + }, + { + "path": "/user/hand/right/pose/tip", + "output": "/actions/game/in/posetip" + } + ], + "sources": [ + { + "path": "/user/hand/left/input/trigger", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/game/in/shootalt" + } + } + }, + { + "path": "/user/hand/right/input/trigger", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/game/in/shoot" + } + } + }, + { + "path": "/user/hand/right/input/trackpad", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/game/in/weaponswitchright" + } + } + }, + { + "path": "/user/hand/left/input/trackpad", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/game/in/weaponswitchleft" + } + } + }, + { + "path": "/user/hand/left/input/thumbstick", + "mode": "joystick", + "inputs": { + "position": { + "output": "/actions/game/in/movement" + } + } + }, + { + "path": "/user/hand/right/input/thumbstick", + "mode": "joystick", + "inputs": { + "position": { + "output": "/actions/game/in/look" + } + } + }, + { + "path": "/user/hand/right/input/thumbstick", + "mode": "dpad", + "parameters": { + "sub_mode": "touch" + }, + "inputs": { + "north": { + "output": "/actions/game/in/dash" + }, + "south": { + "output": "/actions/game/in/jump" + } + } + }, + { + "path": "/user/hand/left/input/b", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/game/in/openmenu" + } + } + }, + { + "path": "/user/hand/left/input/a", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/game/in/weaponswitchpaz" + } + } + }, + { + "path": "/user/hand/right/input/b", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/game/in/slaughter" + } + } + }, + { + "path": "/user/hand/right/input/a", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/game/in/reload" + } + } + } + ] + }, + "/actions/menu": { + "sources": [ + { + "path": "/user/hand/left/input/trigger", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/menu/in/select" + } + } + }, + { + "path": "/user/hand/right/input/trigger", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/menu/in/select" + } + } + }, + { + "path": "/user/hand/right/input/trackpad", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/menu/in/nexttab" + } + } + }, + { + "path": "/user/hand/left/input/trackpad", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/menu/in/prevtab" + } + } + }, + { + "path": "/user/hand/left/input/thumbstick", + "mode": "joystick", + "inputs": { + "position": { + "output": "/actions/menu/in/navigate" + } + } + }, + { + "path": "/user/hand/right/input/thumbstick", + "mode": "joystick", + "inputs": { + "position": { + "output": "/actions/menu/in/navigate" + } + } + }, + { + "path": "/user/hand/left/input/b", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/menu/in/closemenu" + } + } + }, + { + "path": "/user/hand/right/input/b", + "mode": "button", + "inputs": { + "click": { + "output": "/actions/menu/in/back" + } + } + } + ] + } +} \ No newline at end of file diff --git a/SteamVR_IL2CPP/Scripts/SteamVR.cs b/SteamVR_IL2CPP/Scripts/SteamVR.cs index 4ef675c..78370e1 100644 --- a/SteamVR_IL2CPP/Scripts/SteamVR.cs +++ b/SteamVR_IL2CPP/Scripts/SteamVR.cs @@ -927,7 +927,10 @@ public static void InitUnityHookRenderEventFuncCallback(IntPtr hModule) private static CallbackPointer ourGetRenderEventFunc; - public static IntPtr GetRenderEventFunc() => ourGetRenderEventFunc(); + [DllImport("openvr_api", EntryPoint = "UnityHooks_GetRenderEventFunc")] + public static extern IntPtr GetRenderEventFunc(); + + //public static IntPtr GetRenderEventFunc() => ourGetRenderEventFunc(); } }