Gamepad.connected
特性为
Gamepad
interface returns a boolean indicating whether the gamepad is still connected to the system.
If the gamepad is connected, the value is
true
; if not, it is
false
.
readonly attribute boolean connected;
var gp = navigator.getGamepads()[0]; console.log(gp.connected);
A
boolean
.
| 规范 | 状态 | 注释 |
|---|---|---|
|
Gamepad
The definition of 'Gamepad.connected' in that specification. |
工作草案 | 初始定义 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
connected
|
Chrome
35
|
Edge 12 |
Firefox
29
|
IE No |
Opera
22
|
Safari 10.1 | WebView Android No |
Chrome Android
35
|
Firefox Android 32 |
Opera Android
22
|
Safari iOS 10.3 |
Samsung Internet Android
4.0
|
完整支持
不支持
用户必须明确启用此特征。
要求使用供应商前缀或不同名称。