Keydown () and key hold

$(document).keydown(myOnKeyDownFunction);

I notice that in Chrome 10.0 and Firefox 3.6 (as in Ubuntu), after registering a listener for keydown, the callback starts once immediately, followed by a short delay, and then starts again several times until the key is released. For my current project, it makes my life easier ... but can I expect it to behave like it does for all browsers?

+3
source share
2 answers

There's a (possibly outdated) summary of how different browsers handle keystrokes and automatic keyboard repetition at http://unixpapa.com/js/key.html

+4
source

, .

, , - , .

+2

All Articles