Cannot get Vive Tracker touchpad press input after upgrading to VIU 1.17 (API issue found, see thread)
Yuuki-Ishimaru opened this issue · 3 comments
After upgrading to VIU 1.17 I cannot get Vive Tracker input, even though the role has been assigned, the Shift-B assignment has been done, and I can see that the tracker's input is triggering as expected in the SteamVR Test Controller UI.
Unity version is 2020.1.3f1. The configurations are set to build for windows, using the Vive and Vive Pro. The project also has the Wave package as we also target the Focus 3, testing with it disabled in VIUSettings did not change the results
Every other button seems to work but the trackpad button.
Note: In SteamVRv2Module.cs, adding a print statement for action states (UpdateDeviceInput -> first foreach loop) it seems like the input is being registered and IVRModuleDeviceStateRW's value for VRModuleRawButton.Touchpad/ VRModuleRawButton.Axis0 is being set to TRUE when connected as expected. As for why this information isn't propagating to the API I have no idea. I am checking the state through the API using ViveInput.GetPressEx(TrackerRole.Tracker1, ControllerButton.Pad) in the update loop.
@chengnay Found out why pad button input isn't going through in the API.
Reason is that ControllerState currently requires currentInput2DType to be assigned to something other than None for the IVRModuleDeviceState to read and use currState.GetButtonPress(VRModuleRawButton.Touchpad) and the same for GetButtonTouch (both of which have the correct button state stored already)
But ControllerState for the VRModuleDeviceClass.GenericTracker never has the CurrentInput2DType assigned (while other device types get it assigned in VRModuleBase.SetupKnownDeviceModel, likely because it doesn't make sense for it to be assigned on a tracker that doesn't have a trackpad.
The fix was to go into ControllerState.RCtrlState.Update() and change the Touchpad assignment so that if currentInput2DType == VRModuleInput2DType.None, it would assign the touchpad button states to the correct read values instead of false.
See the adjusted version of ControllerState.cs attached
ControllerState.cs.txt