تکه کدی برای ضبط دکمه های کیبرد:
var isOpera = (navigator.userAgent.indexOf('Opera') != -1);
var isIE = (!isOpera && navigator.userAgent.indexOf('MSIE') != -1);
var keyPressed = 0;
if(!isIE){
document.captureEvents(Event.KEYPRESS);
}
function captureKeyboard(e) {
e=e?e:event;
document.title = event.keyCode + ' - ' + e.keyCode;
if (isIE) {
keyPressed = e.keyCode;
}else{
keyPressed = e.charCode;
}
window.status = keyPressed;
return true;
}