VRButtonHit ( hand,button )

Parameters

hand - 0 for the left controller, 1 for the right

button - which button:
1 - trigger
2 - grip (squeeze)
3 - primary: A on the right controller, X on the left
4 - secondary: B on the right controller, Y on the left
5 - menu
6 - thumbstick click

Description

Returns how many times a controller button was pressed since the last call.

It works like KeyHit: each call returns the presses since the previous call for that hand and button, then starts counting again from zero. The trigger and the grip count a press when pulled a little over half way in.

See VRButtonDown for which buttons each controller has. Presses are not counted while another application has the headset's focus.

Returns 0 while VR is not enabled, or for a hand or button outside the lists above.

Automatic VR is experimental, and works in 64-bit Windows programs through an OpenXR runtime and Direct3D 12. In 32-bit programs the commands are there, so the same source compiles, but InitVR returns False and VRLastError says why.

For the full story - setup, frame rules and limitations - see the Automatic PC VR guide and its complete AutomaticVR.bb sample.


See also: VRButtonDown, VRAxis, KeyHit.

Index