Properties:
Name | Type | Description |
---|---|---|
connected |
bool | [readonly] Whether the gamepad is currently connected. |
canRumble |
bool | [readonly] Whether the gamepad supports rumbling (force-feedback vibration). |
index |
number | (default: |
name |
string | [readonly] The name of the gamepad. |
axes |
Array.<number> | [readonly] Array of the axes' values. |
buttons |
Array.<bool> | [readonly] Array of the states of the buttons. |
triggers |
Array.<number> | [readonly] Array of the analog values of the buttons/triggers. |
Extends
Methods
-
Makes the gamepad rumble if supported.
Name Type Description intensity
number A value between
0
and1
describing the rumbling intensity.duration
number The rumbling duration in milliseconds.
callback
function An optional callback that tells when the rumbling is over.