Scubanaked
08-19-2002, 03:30 AM
I need some help with an issue that for the last week has been my nighmare. I have
been programming html for two years and php/mysql for about eight monthes, so I'm pretty new at this. Anyways, I have been searching and
reading and trying very hard to implement java hotkeys into a simple html page. I have found about five ways to do the hot key itself ( that
work). Although I wouldn't say I have a very strong grasp of which thing in the script are variables, which things are functions and which
things are java commands. Anyways, I have also found some applets that test wether a modifier is present.
I am having serious trouble putting the two together. This is the closest I've gotten:
<script language="JavaScript1.2">
if (document.layers)
document.captureEvents(Event.KEYPRESS)
function backhome(e)
{
if (document.layers)
{
if (evt.isAltDown())
{
if (e.which==117)
window.location="http://www.internetfresno.com/madera/index.php?app1=takemsg&login=<?echo$login;?>"
}
}
else if (document.all)
{
if (evt.isAltDown())
{
if (event.keyCode==117)
window.location="http://www.internetfresno.com/madera/index.php?app1=takemsg&login=<?echo$login;?>"
}
}
}
document.onkeypress=backhome
</script>
But it doesn't work.
I would like this to work in Internet explorer 5 and Netscape 4.75 would be a bonus, but not necessary. All I really need is for when the user
presses either Alt-U or Ctrl-U or even a function key for an a href to fire a simple link. The cursor is positioned in a text box, so a normal key won't do.
I've poured through page after page of java scripts. I
would be in your debt if you could help me with this.
Enjoy my site. www.scubanaked.com (it's not porn)
and email me at brian@scubanaked.com
Thank you
Brian Kempe
Fresno California
been programming html for two years and php/mysql for about eight monthes, so I'm pretty new at this. Anyways, I have been searching and
reading and trying very hard to implement java hotkeys into a simple html page. I have found about five ways to do the hot key itself ( that
work). Although I wouldn't say I have a very strong grasp of which thing in the script are variables, which things are functions and which
things are java commands. Anyways, I have also found some applets that test wether a modifier is present.
I am having serious trouble putting the two together. This is the closest I've gotten:
<script language="JavaScript1.2">
if (document.layers)
document.captureEvents(Event.KEYPRESS)
function backhome(e)
{
if (document.layers)
{
if (evt.isAltDown())
{
if (e.which==117)
window.location="http://www.internetfresno.com/madera/index.php?app1=takemsg&login=<?echo$login;?>"
}
}
else if (document.all)
{
if (evt.isAltDown())
{
if (event.keyCode==117)
window.location="http://www.internetfresno.com/madera/index.php?app1=takemsg&login=<?echo$login;?>"
}
}
}
document.onkeypress=backhome
</script>
But it doesn't work.
I would like this to work in Internet explorer 5 and Netscape 4.75 would be a bonus, but not necessary. All I really need is for when the user
presses either Alt-U or Ctrl-U or even a function key for an a href to fire a simple link. The cursor is positioned in a text box, so a normal key won't do.
I've poured through page after page of java scripts. I
would be in your debt if you could help me with this.
Enjoy my site. www.scubanaked.com (it's not porn)
and email me at brian@scubanaked.com
Thank you
Brian Kempe
Fresno California