Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW TO TRIGGER AN EVENT FROM A KEY

Status
Not open for further replies.

alexfusion

Programmer
Feb 5, 2001
94
AR
Hello Everybody:
I would like to know how to trigger an event or an action from a key.For instance I want to show a result page pressing F1 or F2,etc.
Any help welcome!

alexfusion

mixale@hotmail.com
 
Hi alexfusion


That's a Javascript thing, Let me see, I picked this up as a nice little (cross browser) key pressed event type thingy:

function keyPress(evnt)
{
if (document.layers) theKey = evnt.which;
else if (document.all) theKey = event.keyCode;
return (String.fromCharCode(theKey)!='¦')
}

I'm not a great Javascripter but maybe you can figure it out from that. Otherwise check with the guys over at the Javascript Forum. Hope you get it.


 
What A dork I am. Here is the trigger:

onKeyPress="keyPress(event)"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top