Interface: GamepadLike
Defined in: src/interaction/GamepadInput.ts:64
The subset of a Gamepad the controller reads. A real Gamepad satisfies
this shape, so navigator.getGamepads() feeds the controller directly, and a
test injects a plain object with the same fields.
Properties
axes
readonlyaxes: readonlynumber[]
Defined in: src/interaction/GamepadInput.ts:76
The axis values in [-1, 1], indexed by the standard-mapping order.
buttons
readonlybuttons: readonlyGamepadButtonLike[]
Defined in: src/interaction/GamepadInput.ts:74
The button states, indexed by the standard-mapping order.
connected?
readonlyoptionalconnected:boolean
Defined in: src/interaction/GamepadInput.ts:70
Whether the pad is connected. Absent is treated as connected.
id?
readonlyoptionalid:string
Defined in: src/interaction/GamepadInput.ts:68
The device id, when the pad exposes one.
index
readonlyindex:number
Defined in: src/interaction/GamepadInput.ts:66
The pad's index in the snapshot array.
mapping?
readonlyoptionalmapping:string
Defined in: src/interaction/GamepadInput.ts:72
The W3C mapping name, typically 'standard'.