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
Gamepad
The definition of 'GamepadEvent_' in that specification.
Working Draft Initial definition.

Browser compatibility

 

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 35Edge Full support 12Firefox 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 NoOpera Full support 22Safari No support NoWebView Android No support NoChrome Android Full support 35Edge Mobile Full support YesFirefox Android Full support 32Opera Android Full support 22Safari iOS No support NoSamsung 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.

Document Tags and Contributors

Contributors to this page: jpmedley
Last updated by: jpmedley,