keyboard
01-24-2012, 04:16 AM
Hello everyone, found this script on the net (I've made some changes)
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript1.2">
<!--
function IEKeyCap()
{
if (window.event.keyCode == 72)
{
alert('That\'s the H key');
var myNum = 1;
}
if(myNum == 1){
if (window.event.keyCode == 105)
{
alert('That\'s the i key');
}
}
}
//-->
</SCRIPT>
</HEAD>
<BODY onKeyPress="IEKeyCap()">
</BODY>
</HTML>
I want it so that the user has to enter "Hi" for something to happen. It dosen't have to be secure and it only has to work in IE.
When I type "H" it comes up the message That's the H key, but after that when I enter I, nothing happens. Any help?
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript1.2">
<!--
function IEKeyCap()
{
if (window.event.keyCode == 72)
{
alert('That\'s the H key');
var myNum = 1;
}
if(myNum == 1){
if (window.event.keyCode == 105)
{
alert('That\'s the i key');
}
}
}
//-->
</SCRIPT>
</HEAD>
<BODY onKeyPress="IEKeyCap()">
</BODY>
</HTML>
I want it so that the user has to enter "Hi" for something to happen. It dosen't have to be secure and it only has to work in IE.
When I type "H" it comes up the message That's the H key, but after that when I enter I, nothing happens. Any help?