Hi all!
I want to retrieve the keycode when a key is pressed on my object in my HTML page.
This is what I tried:
<OBJECT ID="RSPcli" CLASSID="CLSID:24B4E4FA-5E05-4800-BBCC-20B8D5F8A811" height=490 Width=979 align="center" onKeyDown="trapKeys()"></OBJECT>
function trapKeys() {
if (document.all.RSPcli.object.event.keyCode==40){
alert("key "+String(document.all.RSPcli.object.event.keyCode))
}
}
</script>
I can't reach the object's event, any ideas of the proper syntax? i know in the case of window its window.event.keyCode, however if the object has the focus its the object trapping the keys.
Thanxs!
Cheers,
Alej
I want to retrieve the keycode when a key is pressed on my object in my HTML page.
This is what I tried:
<OBJECT ID="RSPcli" CLASSID="CLSID:24B4E4FA-5E05-4800-BBCC-20B8D5F8A811" height=490 Width=979 align="center" onKeyDown="trapKeys()"></OBJECT>
function trapKeys() {
if (document.all.RSPcli.object.event.keyCode==40){
alert("key "+String(document.all.RSPcli.object.event.keyCode))
}
}
</script>
I can't reach the object's event, any ideas of the proper syntax? i know in the case of window its window.event.keyCode, however if the object has the focus its the object trapping the keys.
Thanxs!
Cheers,
Alej