GamepadHapticActuator:pulse() 方法
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
GamepadHapticActuator
接口的 pulse()
方法使硬件脉冲在特定的持续时间内具有特定的强度。
语法
js
pulse(value, duration)
参数
返回值
当脉冲成功完成时,返回一个兑现为 true
的 Promise。
示例
js
const gamepad = navigator.getGamepads()[0];
gamepad.hapticActuators[0].pulse(1.0, 200);
规范
Specification |
---|
Gamepad Extensions # dom-gamepadhapticactuator-pulse |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
pulse |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
The compatibility table on 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.