diff --git a/content/docs/fossvr/opencomposite/_index.md b/content/docs/fossvr/opencomposite/_index.md index d842a71..f20bd34 100644 --- a/content/docs/fossvr/opencomposite/_index.md +++ b/content/docs/fossvr/opencomposite/_index.md @@ -16,3 +16,47 @@ Please note the OpenVR implementation is incomplete and contains only what's nec OpenComposite is required for Steam Play games to work in VR regardless of API. Due to the number of confounding factors surrounding setup, sandboxing, and more quirks; we recommend you use Envision to setup and manage your VR. Contributions to improve the OpenVR to OpenXR mapping are welcome. + +## Rebinding Controls + +> Changing OpenVR bindings is currently a very manual process. This will change in the future. + +We're going to be using VRChat as an example, but this should apply to just about any OpenVR game. + +First, we locate where the bindings are stored. For Unity games this is always in `GameName_Data/StreamingAssets/SteamVR`. + +In the case of VRChat, it would be in `PATH_TO_STEAM/steamapps/common/VRChat/VRChat_Data/StreamingAssets/SteamVR/` + +Create a folder next to the game's executable called `OpenComposite`. Make a copy of the bindings file for your controller and place it in the `OpenComposite` folder. Open it up and look for `controller_type`, it's typically near the bottom of the file. + +```json +"controller_type" : "knuckles", +``` + +Rename the copy you've made to the value of `controller_type`. + +In my case i've ended up with a copy of the valve index bindings named `knuckles.json` located in `PATH_TO_STEAM/steamapps/common/VRChat/OpenComposite/knuckles.json`. + +Going back to the location of the original bindings, open up `actions.json`, which defines every possible action in the game. A popular binding is changing the microphone button to toggle gestures. We'll use tihs as an example. + +in `actions.json`, we can find the name of the desired actions. +```json +"/actions/Global/in/Mic": "Toggle Microphone", //the one we want to replace +"/actions/Global/in/Gesture_Toggle": "Gesture Toggle", //the one we want to replace it with +``` + +in our copy `knuckles.json`, we can then look for `actions/Global/in/Mic` and replace it with `Gesture_Toggle` like this: + +```json +{ + "inputs" : { + "click" : { + "output" : "/actions/global/in/Gesture_Toggle" + } + }, + "mode" : "button", + "path" : "/user/hand/left/input/a" +}, +``` + +And that's it! OpenComposite will automatically pick up these files as long as they're placed and named correctly, and load them instead of the game's provided ones.