Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



This 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...


The Gamepad API is fun, but we’re not trying to implement a gamepad.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: