GamepadHapticActuator

这是 实验性技术
检查 浏览器兼容性表格 在生产中使用这之前。

GamepadHapticActuator interface of the 手柄 API represents hardware in the controller designed to provide haptic feedback to the user (if available), most commonly vibration hardware.

This interface is accessible through the Gamepad.hapticActuators 特性。

特性

GamepadHapticActuator.type 只读
Returns an enum representing the type of the haptic hardware.

方法

GamepadHapticActuator.pulse() 只读
Makes the hardware pulse at a certain intensity for a specified duration.

范例

TBD.

规范

规范 状态 Comment
Gamepad Extensions
The definition of 'GamepadHapticActuator' in that specification.
编者草案 初始定义

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
GamepadHapticActuator
Chrome 68 Edge 15 Firefox Yes
Disabled
Yes
Disabled
The flag is enabled by default in Firefox Nightly and Beta, versions 55 and above.
Disabled This feature is behind the dom.gamepad-extensions.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE No Opera 55 Safari No WebView Android No Chrome Android 68 Firefox Android No Opera Android 48 Safari iOS No Samsung Internet Android 10.0
playEffect
非标
Chrome 68 Edge 15 Firefox No IE No Opera 55 Safari No WebView Android No Chrome Android 68 Firefox Android No Opera Android 48 Safari iOS No Samsung Internet Android 10.0
pulse
Chrome No Edge 15 — 79 Firefox Yes
Disabled
Yes
Disabled
The flag is enabled by default in Firefox Nightly and Beta, versions 55 and above.
Disabled This feature is behind the dom.gamepad-extensions.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
reset
非标
Chrome 68 Edge 15 Firefox No IE No Opera 55 Safari No WebView Android No Chrome Android 68 Firefox Android No Opera Android 48 Safari iOS No Samsung Internet Android 10.0
type
Chrome 68 Edge 15 Firefox Yes
Disabled
Yes
Disabled
The flag is enabled by default in Firefox Nightly and Beta, versions 55 and above.
Disabled This feature is behind the dom.gamepad-extensions.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE No Opera 55 Safari No WebView Android No Chrome Android 68 Firefox Android No Opera Android 48 Safari iOS No Samsung Internet Android 10.0

图例

完整支持
完整支持
不支持
不支持
实验。期望将来行为有所改变。
实验。期望将来行为有所改变。
非标。预期跨浏览器支持较差。
非标。预期跨浏览器支持较差。
见实现注意事项。
用户必须明确启用此特征。
用户必须明确启用此特征。

另请参阅