| Author |
Scubanaked needs help with hotkeys w/mods
|
Brian Kempe
Greenhorn
Joined: Aug 18, 2002
Posts: 2
|
|
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
|
 |
Brian Kempe
Greenhorn
Joined: Aug 18, 2002
Posts: 2
|
|
Thankfully Someone at WebXPerts.net helped me with this code: <a href="http://www.url.com" onfocus="window.location='http://www.url'" accesskey="A"> <u>A</u>nother link </a> Problem Solved
|
 |
Frank Carver
Sheriff
Joined: Jan 07, 1999
Posts: 6913
|
|
|
Sorry we couldn't help, but I'm glad you got a solution and found time to share it with us. Thanks.
|
A Convergent Visionary ~ Frank's Punchbarrel Blog ~ LinkedIn profile
|
 |
 |
|
|
subject: Scubanaked needs help with hotkeys w/mods
|
|
|