There is a slight pause after any first keypress. Here's the log:
[00.000ms] keypress -- first keypress [496.00ms] keypress -- second keypress after 496 ms [39.000ms] keypress -- every other keypress after about 20-40 ms. [41.000ms] keypress [21.000ms] keypress [39.000ms] keypress ...
So there's a pause of half a second after a first keypress, the rest is fired after 20-40 ms.
This is the code to grab the keypresses:
// If we're using the webkit engine, capture the keydowns
if(navigator.userAgent.indexOf("WebKit") != -1){
window.onkeydown = onKeyPress;
} else{
// If we're using gecko, capture the keypress
if(navigator.userAgent.indexOf("Gecko") != -1){
window.onkeypress = onKeyPress;
}
}
The first thing the onKeyPress function performs is a debug output (the one from the log above)
Does anyone know why the pause is there? It's like that on Windows or Linux; Firefox or Chrome.