Gamepad class

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

MDN Reference

Available extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

Gamepad()
factory

Properties

axes ReadonlyArray<num>

Available on Gamepad, provided by the Gamepad$Typings extension

MDN Reference
no setter
buttons ReadonlyArray<GamepadButton>

Available on Gamepad, provided by the Gamepad$Typings extension

MDN Reference
no setter
connected bool

Available on Gamepad, provided by the Gamepad$Typings extension

MDN Reference
no setter
hapticActuators ReadonlyArray<GamepadHapticActuator>

Available on Gamepad, provided by the Gamepad$Typings extension

MDN Reference
no setter
hashCode int
The hash code for this object.
no setterinherited
id String

Available on Gamepad, provided by the Gamepad$Typings extension

MDN Reference
no setter
index num

Available on Gamepad, provided by the Gamepad$Typings extension

MDN Reference
no setter
mapping GamepadMappingType

Available on Gamepad, provided by the Gamepad$Typings extension

MDN Reference
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timestamp num

Available on Gamepad, provided by the Gamepad$Typings extension

MDN Reference
no setter
vibrationActuator GamepadHapticActuator?

Available on Gamepad, provided by the Gamepad$Typings extension

no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited