GamepadEvent()

GamepadEvent_ 构造函数用于创建一个新的 GamepadEvent 对象。

语法

var gamepadEvent = new GamepadEvent(typeArg, options)

参数

typeArg
一个 DOMString ,必须为 gamepadconnected 或 gamepaddisconnected
options 可选
选项如下所示:
  • gamepad: 一个 Gamepad 实例,描述了与事件相关的控制器(对象)。

规范

规范 状态 备注
Gamepad
GamepadEvent_
Working Draft 初始定义

浏览器兼容性

 

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.

文档标签和贡献者

此页面的贡献者: zsxeee
最后编辑者: zsxeee,