I’m using jQuery hotkeys plugin with the following code:
$(document).bind('keydown', 'right', function(){
console.log('fired');
display_info();
});
When the right button is pressed, the display_info(); is called about 3-4 times. How do I catch the keypresses slower?
Thanks!!
Try keyup rather than keydown, or build a timer.
Here’s a quick and dirty timer I knocked up which should give you a good idea of what you need to do: http://jsfiddle.net/Grimdotdotdot/bnM4T/6/