3 ms·
I fought with this so much today. Our robots can be driven remotely via a web app. But there’s ways to accidentally get buttons stuck down because keyup is nev
by Waterluvian 3y ago
I fought with this so much today.
Our robots can be driven remotely via a web app. But there’s ways to accidentally get buttons stuck down because keyup is never guaranteed and you can’t get key state. Two cases: holding down forward key and blur the tab, or open contextmenu.
There’s workarounds of course. But it’s comical spending so much time on something so simplistic.
- pininja 3y agoThis might be an appropriate use for the Gamepad API which can be queried on every animation frame for a button’s state. https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API...
- Waterluvian 3y agoThe Gamepad API is fun, but we’re not trying to implement a gamepad.