@threlte/xr
useControllerEvent
Adds event listeners for one or more controllers.
Any event listener that can be added to a <Controller>
component can be added here.
<script>
import { useControllerEvent } from '@threlte/xr'
useControllerEvent('squeeze', (event: XRControllerEvent) => {
})
</script>
An optional third parameter can be provided for filtering by handedness or input.
By default, no filtering occurs.
<script>
import { useControllerEvent } from '@threlte/xr'
useControllerEvent('select', (event: XRControllerEvent) => {
}, {
handedness: 'left' | 'right' | 'none',
})
</script>