Interface Gamepad

This Gamepad API interface defines an individual gamepad or other controller, allowing access to information such as button presses, axis positions, and id.

MDN Reference

interface Gamepad {
    axes: readonly number[];
    buttons: readonly GamepadButton[];
    connected: boolean;
    id: string;
    index: number;
    mapping: GamepadMappingType;
    timestamp: number;
    vibrationActuator: GamepadHapticActuator;
}

Properties

axes: readonly number[]
buttons: readonly GamepadButton[]
connected: boolean
id: string
index: number
timestamp: number
vibrationActuator: GamepadHapticActuator