Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get Vive Tracker touchpad press input after upgrading to VIU 1.17 (API issue found, see thread) #239

Open
Yuuki-Ishimaru opened this issue Sep 23, 2022 · 3 comments

Comments

@Yuuki-Ishimaru
Copy link

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

@Yuuki-Ishimaru
Copy link
Author

Every other button seems to work but the trackpad button.

@Yuuki-Ishimaru Yuuki-Ishimaru changed the title Cannot get Vive Tracker input after upgrading to VIU 1.17 Cannot get Vive Tracker touchpad press input after upgrading to VIU 1.17 Sep 23, 2022
@Yuuki-Ishimaru
Copy link
Author

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.

@Yuuki-Ishimaru Yuuki-Ishimaru changed the title Cannot get Vive Tracker touchpad press input after upgrading to VIU 1.17 Cannot get Vive Tracker touchpad press input after upgrading to VIU 1.17 (API issue found, see thread) Sep 26, 2022
@Yuuki-Ishimaru
Copy link
Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant