This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2017.
* Some parts of this feature may have varying levels of support.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The Gamepad API is a way for developers to access and respond to signals from gamepads and other game controllers in a simple, consistent way. It contains three interfaces, two events and one specialist function, to respond to gamepads being connected and disconnected, and to access other information about the gamepads themselves, and what buttons and other controls are currently being pressed.
GamepadRepresents a gamepad/controller connected to the computer.
Represents a button on one of the connected controllers.
GamepadEventThe event object representing events fired that are related to gamepads.
GamepadHapticActuatorRepresents hardware in the controller designed to provide haptic feedback to the user (if available), most commonly vibration hardware.
GamepadPoseRepresents the pose of a controller (e.g., position and orientation in 3D space) in the case of a WebVR controller. This is not used by the newer WebXR standard.
An extension to the Navigator object that returns an array of Gamepad objects, one for each connected gamepad.
gamepadconnectedAn event that will fire when a gamepad is connected.
gamepaddisconnectedAn event that will fire when a gamepad is disconnected.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
Gamepad_API |
21 | 12 | 29 | 15 | 10.1 | 25 | 32 | 14 | 10.3 | 1.5 | 4.4 | 10.3 |
axes |
21 | 12 | 29 | 15 | 10.1 | 25 | 32 | 14 | 10.3 | 1.5 | 4.4 | 10.3 |
buttons |
21 | 12 | 29 | 15 | 10.1 | 25 | 32 | 14 | 10.3 | 1.5 | 4.4 | 10.3 |
connected |
25 | 12 | 29 | 15 | 10.1 | 25 | 32 | 14 | 10.3 | 1.5 | 4.4 | 10.3 |
displayId |
No | 15–79 | 9864–98Only on macOS and Windows.55–64Only on Windows. |
No | No | 55–80Currently supported only by Google Daydream. |
55–98 | 42–57Currently supported only by Google Daydream. |
No | 6.0–13.0Currently supported only by Google Daydream. |
No | No |
hand |
No | 15–79 | 55 | No | No | No | 55 | No | No | No | No | No |
hapticActuators |
No | 15–79 | 55 | No | No | No | 55 | No | No | No | No | No |
id |
21 | 12 | 29 | 15 | 10.1 | 25 | 32 | 14 | 10.3 | 1.5 | 4.4 | 10.3 |
index |
21 | 12 | 29 | 15 | 10.1 | 25 | 32 | 14 | 10.3 | 1.5 | 4.4 | 10.3 |
mapping |
21 | 12 | 29 | 15 | 10.1 | 25 | 32 | 14 | 10.3 | 1.5 | 4.4 | 10.3 |
pose |
No | 15–79 | 55 | No | No | No | 55 | No | No | No | No | No |
secure_context_required |
86 | 86 | 91 | 72 | No | 86 | 91 | No | No | No | No | No |
timestamp |
21 | 12 | 29 | 15 | 10.1 | 25 | 32 | 14 | 10.3 | 1.5 | 4.4 | 10.3 |
vibrationActuator |
68 | 79 | No | 55 | 16.4 | 68 | No | 48 | No | 10.0 | No | No |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API