/ Published in: JavaScript
Usage:
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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; }