GamepadEvent: GamepadEvent() constructor
The GamepadEvent()
constructor creates a new GamepadEvent
object.
Syntax
new GamepadEvent(type, options)
Parameters
type
-
A string with the name of the event. It is case-sensitive and browsers set it to
gamepadconnected
orgamepaddisconnected
. options
-
An object that, in addition of the properties defined in
Event()
, can have the following properties:gamepad
-
A
Gamepad
object describing the gamepad associated with the event.
Return value
A new GamepadEvent
object.
Specifications
Specification |
---|
Gamepad # dom-gamepadevent-constructor |
Browser compatibility
BCD tables only load in the browser