ViveSoftware / ViveInputUtility-Unity

A toolkit that helps developing/prototyping VR apps.
http://u3d.as/uF7
Other
352 stars 82 forks source link

Updating input for Steamvr 2.0 VIU 1.10+ - how to read from new binding names #73

Open wirelessdreamer opened 5 years ago

wirelessdreamer commented 5 years ago

Previously we would read in with a command like:
if (ViveInput.GetPressDown(viveRole, ControllerButton.AKey)){ // lets move }

in steamvr 2.0+ we now define a move role image

but how do we update our above statement to read from the new role, not a hard coded button? we should be reading from /actions/default/in/Move

SteamVR_Input_Actions contains the new entry: image

chengnay commented 5 years ago

Do you want something like this below? 2018-12-26_164605

As long as you clicked on "Save and generate" button from SteamVR Input window, you will be able to assign any input path to it.

Just define a variable as public with corresponding type. public SteamVR_Action_Boolean MyInput;

Does above answering to your question?

wirelessdreamer commented 5 years ago

Previously wiith VIU we would set a public ViveRoleProperty viveRole; for the role the controller was bound to, and read input with ViveInput.GetPress(viveRole, ControllerButton.Menu);

So it was a 2 part issue, SteamVR defines its own roles now, and we should be able to

  1. create new roles that show up in steamvr's controller configuration, and then we should be able to read from a controller role, and action. similar to before, but using the SteamVR 2.0 approach.
chengnay commented 5 years ago

Role in SteamVR input sources are defined statically. Currently, we do not know how to modify this part.