The GamepadEvent() constructor creates a new GamepadEvent object.
Syntax
var gamepadEvent = new GamepadEvent(typeArg, options)
Parameters
- typeArg
- A
DOMStringthat must be one ofgamepadconnectedorgamepaddisconnected. - options Optional
- Options are as follows:
gamepad: An instance ofGamepaddescribing the gamepad associated with the event.
Specifications
| Specification | Status | Comment |
|---|---|---|
| Gamepad The definition of 'GamepadEvent_' in that specification. |
Working Draft | Initial definition. |
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
GamepadEvent() constructor | Chrome Full support 35 | Edge Full support 12 | Firefox
Full support
29
| IE No support No | Opera Full support 22 | Safari Full support 10.1 | WebView Android No support No | Chrome Android Full support Yes | Firefox Android Full support 32 | Opera Android Full support 22 | Safari iOS Full support 10.3 | Samsung Internet Android Full support Yes |
Legend
- Full support
- Full support
- No support
- No support
- User must explicitly enable this feature.
- User must explicitly enable this feature.
