Gamepad (WebXR)Limited availability
The gamepad attribute of an XRInputSource represents an XR input device, such as a motion controller, that reports data from physical inputs (such as buttons, touch pads, and triggers).
Not yet supported in all major browsers — check the table and provide a fallback.
Browser support
DesktopChrome
1–78Not supported
79+Supportedsince Dec 10, 2019
Current: 155Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154Firefox
✕Not supportedup to 157
Current: 157Safari
✕Not supportedup to 27
Current: 27MobileChrome Android
18–78Not supported
79+Supportedsince Dec 17, 2019
Current: 155Firefox Android
✕Not supportedup to 157
Current: 157Safari iOS
✕Not supportedup to 27
Current: 27How to use
Not supported in Firefox, Safari, Firefox Android, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.
Example
Full syntax and examples are on MDN: gamepad.
Feature detection
JS · check before using
if ("XRInputSource" in globalThis && "gamepad" in XRInputSource.prototype) {
// XRInputSource.gamepad is available
}