useXRControllerButtonEvent

useXRControllerButtonEvent(controller, id, onChange): void

Hook for subscribing to a button state change event on the controller

Parameters

controller

the controller to listen for the event

undefined | XRControllerState

id

XRControllerGamepadComponentId

of the button

onChange

(state) => void

callback that gets executed when the state of the button changes

Returns


void