GamepadBaseline · Widely available
The navigator.getGamepads() API accesses and responds to signals from game controllers.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Mar 27, 2017. Widely available since Sep 27, 2019.
Browser support
DesktopChrome
1–34Not supported
35+Supportedsince May 20, 2014
Current: 155Edge
12+Supportedsince Jul 29, 2015
Current: 154Firefox
1–28Not supported
29+Supportedsince Apr 29, 2014
Current: 157Safari
1–10Not supported
10.1+Supportedsince Mar 27, 2017
Current: 27MobileChrome Android
18–34Not supported
35+Supportedsince May 20, 2014
Current: 155Firefox Android
4–31Not supported
32+Supportedsince Sep 2, 2014
Current: 157Safari iOS
1–10Not supported
10.3+Supportedsince Mar 27, 2017
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN: Gamepad.
Feature detection
JS · check before using
if ("Gamepad" in globalThis) {
// Gamepad is available
} else {
// load a polyfill or use a fallback
}Documentation (MDN)
Specification
Usage share
Sub-features
Support for each part of the feature (18). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| Gamepad | 21 | 12 | 29 | 10.1 | 25 | 32 | 10.3 |
| Gamepad.axes | 21 | 12 | 29 | 10.1 | 25 | 32 | 10.3 |
| Gamepad.buttons | 21 | 12 | 29 | 10.1 | 25 | 32 | 10.3 |
| Gamepad.connected | 25 | 12 | 29 | 10.1 | 25 | 32 | 10.3 |
| Gamepad.id | 21 | 12 | 29 | 10.1 | 25 | 32 | 10.3 |
| Gamepad.index | 21 | 12 | 29 | 10.1 | 25 | 32 | 10.3 |
| Gamepad.mapping | 21 | 12 | 29 | 10.1 | 25 | 32 | 10.3 |
| Gamepad.timestamp | 21 | 12 | 29 | 10.1 | 25 | 32 | 10.3 |
| GamepadButton | 21 | 12 | 29 | 10.1 | 25 | 32 | 10.3 |
| GamepadButton.pressed | 21 | 12 | 29 | 10.1 | 25 | 32 | 10.3 |
| GamepadButton.value | 21 | 12 | 29 | 10.1 | 25 | 32 | 10.3 |
| GamepadEvent | 21 | 12 | 29 | 10.1 | 25 | 32 | 10.3 |
| GamepadEvent.GamepadEvent | 35 | 12 | 29 | 10.1 | 35 | 32 | 10.3 |
| GamepadEvent.gamepad | 21 | 12 | 29 | 10.1 | 25 | 32 | 10.3 |
| Navigator.getGamepads | 35 | 12 | 29 | 10.1 | 35 | 32 | 10.3 |
| Window.gamepadconnected_event | 143 | 143 | 89 | 16 | 143 | 89 | 16 |
| Window.gamepaddisconnected_event | 143 | 143 | 89 | 16 | 143 | 89 | 16 |
| iframe.allow.gamepad | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |