Re: [w3c/gamepad] Xbox One impulse trigger effects (#138)

The activation method could be the same as for `dual-rumble` effects but with a different set of parameters.

```
// 1 second dual-rumble effect (100% strong, 50% weak)
navigator.getGamepads()[0].vibrationActuator.playEffect("dual-rumble", {
    strongMagnitude: 1.0,
    weakMagnitude: 0.5,
    duration: 1000
});

// 1 second impulse trigger effect, left trigger (40% magnitude)
navigator.getGamepads()[0].vibrationActuator.playEffect("impulse-trigger-left", {
    magnitude: 0.4,
    duration: 1000
});
```

It might make sense to also have a combined `impulse-trigger` effect to make it easier to send effects to both triggers at the same time.

```
// 1 second impulse trigger effect, both triggers (10% left, 20% right)
navigator.getGamepads()[0].vibrationActuator.playEffect("impulse-trigger", {
    leftMagnitude: 0.1,
    rightMagnitude: 0.2,
    duration: 1000
});
```

The `vibrationActuator` object should also support querying its capabilities so applications can determine if impulse trigger effects are supported.

```
-> navigator.getGamepads()[0].vibrationActuator.effects
<- [ "dual-rumble", "impulse-trigger", "impulse-trigger-left", "impulse-trigger-right" ]
```


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/gamepad/issues/138#issuecomment-661489374

Received on Tuesday, 21 July 2020 00:32:11 UTC