VRButtonDown ( 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 True while a controller button is held down.

It works like KeyDown. The trigger and the grip count as held from a little over half way in; VRAxis gives how far they are pulled.

Controllers differ. The Khronos simple controller has only the trigger (its select button) and menu. Oculus Touch has every button, with menu on the left controller only. Valve Index has A and B on both controllers and no menu. HP Reverb G2 controllers have X and Y on the left, A and B on the right, and menu on both. Windows Mixed Reality controllers have trigger, grip, menu and thumbstick click. A button a controller lacks is never down. Each controller's system or home button belongs to the VR runtime.

The engine reads the controllers once per frame, inside RenderWorld. While another application has the headset's focus every button reads as up.

Returns False 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: VRButtonHit, VRAxis, VRHandPivot, KeyDown.

Index