ValveSoftware / steamvr_unity_plugin

SteamVR Unity Plugin - Documentation at: https://valvesoftware.github.io/steamvr_unity_plugin/
BSD 3-Clause "New" or "Revised" License
1.03k stars 256 forks source link

Controller support in SteamVR binding UI #614

Open m-talha opened 4 years ago

m-talha commented 4 years ago

I'm planning on developing an application using Unity where different input devices (traditional controllers as well virtual reality controllers) can be used interchangeably. The application can be run on both VR headsets and monitors. Examples of controllers I am looking to support include keyboard+mouse, gamepads (xbox, ps4 etc.), joysticks (warthog), VR controllers and leap motion.

I am looking for a way to manage the input from all the different controllers. It seems like SteamVR with its controller binding UI would be a good way to accomplish this. However, I am not sure about the controllers it supports. It can detect the xbox pad fine but I don't see any options for joysticks or mouse+ keyboard. Is it possible to manage these through the UI? Is this even the right way to go about it?

Another option that I've come across is the MRTK library and looking through the source code and documentation, the input system has impressed me as it seems to support various types of controller input. I think I only need the input system of MRTK and the VR side of things I would like to do in SteamVR as I'm not yet considering using a UWP device. Additionally, I don' t think it supports SteamVR so I would have to fall back to Unity' s OpenVR.

Would I be able to get any guidance on how I should approach this? Thanks

dantman commented 4 years ago

The SteamVR UI just manages the actions.json file that Steam VR uses. It's not applicable to controls outside Steam VR.

You'll want to create your own code to abstract controls into actions then map various controls to that. i.e. for Steam VR you'd create the same set of actions and map them to your custom actions. For gamepad/keyboard etc you could see if there was a similar library to map those to actions, then you'd map those actions to your abstract actions.