GamepadEvent() 构造函数创建新 GamepadEvent 对象。

句法

var gamepadEvent = new GamepadEvent(typeArg, options)
					

参数

typeArg
DOMString that must be one of gamepadconnected or gamepaddisconnected .
选项 可选
Options are as follows:
  • gamepad : An instance of Gamepad describing the gamepad associated with the event.

规范

规范 状态 注释
Gamepad
The definition of 'GamepadEvent_' in that specification.
工作草案 初始定义。

浏览器兼容性

The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
GamepadEvent() 构造函数 Chrome 35 Edge 12 Firefox 29
29
不支持 24 — 28 Disabled
Disabled ). To change preferences in Firefox, visit
IE No Opera 22 Safari 10.1 WebView Android No Chrome Android Yes Firefox Android 32 Opera Android 22 Safari iOS 10.3 Samsung Internet Android Yes

图例

完整支持

完整支持

不支持

不支持

用户必须明确启用此特征。

用户必须明确启用此特征。

元数据

  • 最后修改: