GamepadHapticActuator: pulse() method

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The pulse() method of the GamepadHapticActuator interface makes the hardware pulse at a certain intensity for a specified duration.

Syntax

js
pulse(value, duration)

Parameters

value

A double representing the intensity of the pulse. This can vary depending on the hardware type, but generally takes a value between 0.0 (no intensity) and 1.0 (full intensity).

duration

A double representing the duration of the pulse, in milliseconds.

Note: Repeated calls to pulse() override the previous calls if they are still ongoing.

Return value

A promise that resolves with a value of true when the pulse has successfully completed.

Examples

js
const gamepad = navigator.getGamepads()[0];

gamepad.hapticActuators[0].pulse(1.0, 200);

Specifications

Specification
Gamepad Extensions
# dom-gamepadhapticactuator-pulse

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
pulse
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge 15 – 18 (Release date: 2017-04-05)
footnote Removed in 79 and later
Firefox – Full support
Firefox 55 (Release date: 2017-08-08)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – Full support
Firefox for Android 55 (Release date: 2017-08-08)
footnote Full support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

See also