I was wondering if there was a way to gather keystroke metrics in JS such as the timing between two consecutive key presses, the number of keys pressed at once, etc.
@DokOct 11.2008 — #timing between two consecutive key presses[/QUOTE]To record the time of each keystroke you can do [CODE]var time = [];
document.onkeydown = function(e) { time.push(e.timeStamp) };[/CODE] This does not apply to IE. Timestamps for events are measured in milliseconds since boottime. the number of keys pressed at once[/QUOTE]The browser only registers the first key you press no matter how many you press at a time except for the modifyer keys shift, alt and control.
@DokOct 11.2008 — #To add support for IE [CODE]document.onkeydown = function(e) { // If IE if (!e) time.push(new Date()); else time.push(e.timeStamp) };[/CODE] Note that the timestamps in IE will be milliseconds since the Epoch (midnight, 1st of Jan. 1970)