Interface XrControllerComponents
interface XrControllerComponents {
buttonA: XrButtonState | null;
buttonB: XrButtonState | null;
handedness: XrHandedness;
squeeze: XrButtonState | null;
thumbstick: XrButtonState | null;
thumbstickAxes: readonly [number, number] | null;
touchpad: XrButtonState | null;
touchpadAxes: readonly [number, number] | null;
trigger: XrButtonState | null;
}
buttonA: XrButtonState | null;
buttonB: XrButtonState | null;
handedness: XrHandedness;
squeeze: XrButtonState | null;
thumbstick: XrButtonState | null;
thumbstickAxes: readonly [number, number] | null;
touchpad: XrButtonState | null;
touchpadAxes: readonly [number, number] | null;
trigger: XrButtonState | null;
}
Index
Properties
Readonlybutton A
Primary face button (A / X) — buttons[4].
Readonlybutton B
Secondary face button (B / Y) — buttons[5].
Readonlyhandedness
"left", "right", or "none".
Readonlysqueeze
Grip / squeeze — buttons[1].
Readonlythumbstick
Thumbstick press — buttons[3].
Readonlythumbstick Axes
thumbstickAxes: readonly [number, number] | null
Thumbstick [x, y] in [-1, 1] — axes[2], axes[3].
Readonlytouchpad
Touchpad press — buttons[2].
Readonlytouchpad Axes
touchpadAxes: readonly [number, number] | null
Touchpad [x, y] in [-1, 1] — axes[0], axes[1].
Readonlytrigger
Primary trigger — buttons[0].
Decoded
xr-standardcontroller state for one input source. Every field is nullable because a given device may not expose that button/axis pair; callers should null-check before reading. Index conventions follow the WebXRxr-standardgamepad mapping.