w3c / gamepad

Gamepad
https://w3c.github.io/gamepad/
Other
138 stars 49 forks source link

Valid values for GamepadEffectParameters.strongMagnitude / weakMagnitude #176

Closed cdumez closed 1 year ago

cdumez commented 1 year ago

The specification should likely indicate what the valid values for GamepadEffectParameters.strongMagnitude / weakMagnitude are. As far as I can tell, this needs to be a value in the [0; 1] range.

Also, should we throw for values out of range? The specification currently doesn't validate any of the input parameters I think. However, I believe that the Blink implementation validates them and throws.

cdumez commented 1 year ago

cc @marcoscaceres

cdumez commented 1 year ago

Actually, it is specified, just not in the section where I expected it to be:

strongMagnitude and weakMagnitude set the vibration intensity levels for the low-frequency and high-frequency rumble motors, normalized to the range [0,1], default 0. An effect with magnitude values outside of this range is not a valid effect.

It is in the dual-rumble section instead of the section about these dictionary members. That's probably OK.