3 ms·
Uses the Gamepad API. I found it very easy to work with, in large part thanks to the corresponding MDN docs. The only weird part about the Gamepad API is that
by jstrieb 3y ago
Uses the Gamepad API. I found it very easy to work with, in large part thanks to the corresponding MDN docs.
The only weird part about the Gamepad API is that you have to poll it rather than handling events the way you normally would for other, similar stuff in JavaScript. In practice, this means that you have to do your own debouncing for handling things like key combos, but that doesn't really affect individual button presses too much.
- murkle 3y agoMagic, thanks! Which model mat do you have? It might be worth trying with WebHID instead of the GamePad API. Quick example with a joystick :) https://murkle.github.io/utils/webhid/logitech_attack3.html https://murkle.github.io/utils/webhid/logitech_attack3.html
- murkle 3y ago... and a quick example with a very cheap USB Dance Mat https://murkle.github.io/utils/webhid/dance_mat.html https://murkle.github.io/utils/webhid/dance_mat.html