[thelist] Detecting various Keystrokes

Keith cache at dowebscentral.com
Fri Jan 3 16:46:01 CST 2003


Rob

>I know you can detect various key strokes in VB like Shift+Ctl+F4 and the
>program will blow up (It won't). Can you detect similar key stroke actions
>on the Web? Whether it be JavaScript, PHP, CGI, whatever...

This little gem wrx w/javascript and will show you the accumulated key
strokes as you type them.

<html><head>
<script language=javascript>
IE=document.all;
NN=document.layers;
kys="";
if (NN){document.captureEvents(Event.KEYPRESS)}
document.onkeypress=katch
function katch(e){
if (NN){kys+=e.which}
if (IE){kys+=event.keyCode}
document.forms[0].elements[0].value=kys
}
</script>
</head>
<body>
<form><input></form>
</body>
</html>




Keith
====================
cache at dowebscentral.com




More information about the thelist mailing list