Gamepad

js.html.Gamepad (extern class)

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

Documentation Gamepad by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

Instance Members

A DOMString containing identifying information about the controller.


index: Int

An integer that is auto-incremented to be unique for each device currently connected to the system.


A string indicating whether the browser has remapped the controls on the device to a known layout.


connected: Bool

A boolean indicating whether the gamepad is still connected to the system.


An array of gamepadButton objects representing the buttons present on the device.


axes: Array<Float>

An array representing the controls with axes present on the device (e.g. analog thumb sticks).


timestamp: Float

A DOMHighResTimeStamp representing the last time the data for this gamepad was updated.