Get the latest tech news
Three ways of handling user input (2022)
January 5, 2022 Although there has been important progress in models and packages for the output of graphics to computer screens, there has been little change in the way that input from the mouse, keyboard, and other input devices is handled. New graphics standards are still using a fifteen-year-old model even though it is widely accepted as inadequate.
I’ve left out the helper code that takes care of updating the mouse and keyboard variables using the standard DOM events. Conceptually, polling is a pretty simple approach, but it imposes a fair bit of extra complexity on the handling code. To experiment with these ideas in JS, I built a tiny library called Abro.js which provides some slightly higher-level abstractions on top of async and await.
Or read this on Hacker News