Interface GamepadHapticActuator
interface GamepadHapticActuator {
playEffect(
type: GamepadHapticEffectType,
params?: GamepadEffectParameters,
): Promise<GamepadHapticsResult>;
reset(): Promise<GamepadHapticsResult>;
}
playEffect(
type: GamepadHapticEffectType,
params?: GamepadEffectParameters,
): Promise<GamepadHapticsResult>;
reset(): Promise<GamepadHapticsResult>;
}
Index
Methods
Methods
playEffect
- playEffect(
type: GamepadHapticEffectType,
params?: GamepadEffectParameters,
): Promise<GamepadHapticsResult>The
playEffect()method of the GamepadHapticActuator interface causes the hardware to play a specific vibration effect.Parameters
- type: GamepadHapticEffectType
Optionalparams: GamepadEffectParameters
Returns Promise<GamepadHapticsResult>
reset
The
reset()method of the GamepadHapticActuator interface stops the hardware from playing an active vibration effect.Returns Promise<GamepadHapticsResult>
The
GamepadHapticActuatorinterface of the Gamepad API represents hardware in the controller designed to provide haptic feedback to the user (if available), most commonly vibration hardware.MDN Reference