$(document).keydown(myOnKeyDownFunction);
I notice that in Chrome 10.0 and Firefox 3.6 (both in Ubuntu), after registering a listener for keydown, the callback is invoked once immediately, followed by a short delay, and then triggered again repeatedly until the key is released. For my current project, this sure makes my life easier… but can I expect it to behave like that for all browsers?
There’s a (possibly out-of-date) summary of how various browsers handle key presses and keyboard auto-repeat at http://unixpapa.com/js/key.html