nealey / vail

Internet morse code (cw) repeater
16 stars 5 forks source link

Use vibration API #15

Open nealey opened 4 years ago

nealey commented 4 years ago

navigator.vibrate() is actually exactly the same format as vail messages are after the timestamp. In the Buzz method, should be able to add a vibrate call in the timeout callback.

Be sure to expose a switch to enable/disable vibration. Probably ought to default to disabled. And store the selected value in localStorage.

There's no way to detect whether vibration is available on the device, so we'll just have to display the switch for everybody.

nealey commented 3 years ago

It seems there's a way to make a gamepad vibrate too. That would be a really cool feature for blind/deaf users.