Interface GamepadButtonEvent

A button event on the gamepad.

Hierarchy

  • BaseGamepadEvent<"button">
    • GamepadButtonEvent

Properties

control: "button"

The type of control.

down: boolean

Whether the button is pressed.

index: number

The (control-specific) index of the control.

Buttons correspond to the standard layout specified in https://www.w3.org/TR/gamepad/#dfn-standard-gamepad.

Axes are mapped slightly differently:

Web API Standard Gamepad This API
Axis 0 (left stick x-axis) Axis2D 0
Axis 1 (left stick y-axis) Axis2D 0
Axis 2 (right stick x-axis) Axis2D 1
Axis 3 (right stick y-axis) Axis2D 1
Axis n (for n >= 4) Axis (n - 4)
source: string | number

The identifier, unique per client + device combo.

type: "gamepad"

The event type.

value: number

The value of the button (between 0.0 and 1.0, modeled after the Web Gamepad API)

Generated using TypeDoc