Web/API/GamepadEvent/GamepadEvent

From Get docs

The GamepadEvent() constructor creates a new GamepadEvent object.

Syntax

var gamepadEvent = new GamepadEvent(typeArg, options)

Parameters

typeArg
A DOMString that must be one of gamepadconnected or gamepaddisconnected.
options Optional
Options are as follows:
gamepad
  • An instance of Gamepad describing the gamepad associated with the event.

Specifications

Specification Status Comment
GamepadThe definition of 'GamepadEvent_' in that specification. Working Draft Initial definition.

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
GamepadEvent() constructor Chrome

Full support 35

Edge

Full support 12

Firefox Full support 29


Full support 29


No support 24 — 28

Disabled'

Disabled' From version 24 until version 28 (exclusive): this feature is behind the dom.gamepad.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.

IE

No support No

Opera

Full support 22

Safari

Full support 10.1

WebView Android

Full support 37

Chrome Android

Full support 35

Firefox Android

Full support 32

Opera Android

Full support 22

Safari iOS

Full support 10.3

Samsung Internet Android

Full support 3.0

Legend

Full support  
Full support
No support  
No support
User must explicitly enable this feature.'
User must explicitly enable this feature.