Namespace: SpawnDev.SpawnJS.JSObjects
Source: JSObjects/GamepadHapticActuatorType.cs
MDN Reference: GamepadHapticActuatorType on MDN
An enumerated value representing the haptic hardware type. https://developer.mozilla.org/en-US/docs/Web/API/GamepadHapticActuator/type#value
| Name | JSON Value | Description |
|---|---|---|
Vibration |
"vibration" |
Simple vibration hardware, which creates a rumbling effect. |
DualRumble |
"dual-rumble" |
A controller with a vibration motor in each handle. Each motor can be vibrated independently to create positional rumbling effects. |
| Property | Type | Access | Description |
|---|---|---|---|
GamepadHapticActuatorType |
enum |
get | An enumerated value representing the haptic hardware type. https://developer.mozilla.org/en-US/docs/Web/API/GamepadHapticActuator/type#value |
SpawnDev.SpawnJS Mapping Note: The JavaScript examples below show the standard Web API usage. In SpawnDev.SpawnJS, the same API is available with C# conventions:
- Properties and methods use PascalCase (e.g.,
readyStatebecomesReadyState)- Events use ActionEvent with
+=/-=(e.g.,addEventListener("click", fn)becomesOnClick += handler)- Async methods return
Task<T>instead ofPromise<T>- Objects should be disposed with
usingstatements- Access via
JS.Get<GamepadHapticActuatorType>(...)or constructornew GamepadHapticActuatorType(...)
const gamepad = navigator.getGamepads()[0];
// Logs "vibration" or "dual-rumble"
console.log(gamepad.hapticActuators[0].type);