API

Class Gamepad

Represents a gamepad

Hierarchy (View Summary)

Index
  • Initializes the gamepad

    Parameters

    • id: string

      The id of the gamepad

    • index: number

      The index of the gamepad

    • browserGamepad: any

      The browser gamepad

    • leftStickX: number = 0

      The x component of the left joystick

    • leftStickY: number = 1

      The y component of the left joystick

    • rightStickX: number = 2

      The x component of the right joystick

    • rightStickY: number = 3

      The y component of the right joystick

    Returns Gamepad

browserGamepad: any

The browser gamepad

id: string

The id of the gamepad

index: number

The index of the gamepad

type: number

Specifies what type of gamepad this represents

DUALSHOCK: number = 4

Represents an Dual Shock controller

GAMEPAD: number = 0

Represents a gamepad controller

GENERIC: number = 1

Represents a generic controller

POSE_ENABLED: number = 3

Represents a pose-enabled controller

XBOX: number = 2

Represents an XBox controller