API

Interface GamepadState

Application-owned gamepad snapshot. Unknown mappings remain explicit.

interface GamepadState {
    axes: number[];
    buttons: GamepadButtonState[];
    id: string;
    index: number;
    mapping: GamepadMappingType;
    timestamp: number;
}
Index
axes: number[]

Copied raw axis values; the application chooses dead zones.

Copied button values, pressed state and touch state.

id: string

Browser-provided device identifier.

index: number

Browser slot index.

mapping: GamepadMappingType

Only standard guarantees standard button/axis positions.

timestamp: number

Browser-provided update timestamp.