GamepadHapticActuator
Gamepad API
Gamepad API
The **`GamepadHapticActuator`** interface of the [Gamepad API](/docs/Web/API/Gamepad_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 property.
## Instance properties
- GamepadHapticActuator.effects
- : Returns an array of enumerated values representing the different haptic effects that the actuator supports.
- GamepadHapticActuator.type
- : Returns an enumerated value representing the type of the haptic hardware. This property is deprecated: use `GamepadHapticActuator.effects` to detect effect support.
## Instance methods
- GamepadHapticActuator.playEffect()
- : Causes the hardware to play a specific vibration effect.
- GamepadHapticActuator.pulse()
- : Makes the hardware pulse at a certain intensity for a specified duration.
- GamepadHapticActuator.reset()
- : Stops the hardware from playing an active vibration effect.
## Examples
```js
const gamepad = navigator.getGamepads()[0];
gamepad.hapticActuators[0].pulse(1.0, 200);
gamepad.vibrationActuator.playEffect("dual-rumble", {
startDelay: 0,
duration: 200,
weakMagnitude: 1.0,
strongMagnitude: 1.0,
});
```
## Specifications
## Browser compatibility
## See also
- [Gamepad API](/docs/Web/API/Gamepad_API)
Cite this
"GamepadHapticActuator". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/GamepadHapticActuator JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy