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

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

Browser compatibility

BCD tables only load in the browser