KeyboardJS.on('1,2,3,4,5,6,7,8,9,0', function(e) {
console.log(e.which);
});
if I type '45' quickly, where the '4' isn't released yet when the '5' is pressed, the log shows one keypress for '4' but 2 for '5'. I guess the '5' is re-triggered when the '4' is released and KeyboardJS notices a state change?
Happens in Firefox/Safari/Chrome on OS X.
What I'm trying to do is have the user enter a number (most likely 0 - 50) where after the first digit the script pauses a half second to see if there's another digit following. It works, but only if I type the digits separately - when I type 14 quickly it finds 144. Suggestions?
Edit: worked around for now by simply taking a (0,2) slice if length > 2