Наши волонтёры ещё не перевели данную статью на Русский. Присоединяйтесь к нам и помогите сделать эту работу!
Вы можете также прочитать эту статью на English (US).

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 AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Gamepad() constructorChrome 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 Full support 10.1WebView Android No support NoChrome Android Full support 35Firefox Android Full support 32Opera Android Full support 22Safari iOS Full support 10.3Samsung 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.

Метки документа и участники

Внесли вклад в эту страницу: mdnwebdocs-bot, jpmedley
Обновлялась последний раз: mdnwebdocs-bot,