GamepadEvent()

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

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
GamepadEvent
35
12
29
No
22
10.1
37
35
32
22
10.3
3.0

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/GamepadEvent/GamepadEvent