Click to See Complete Forum and Search --> : onkeydown function


nash
10-21-2003, 02:30 PM
Well, I'm still a newbie at JS and I couldn't find the information on the "onkeydown" function that I was looking for...

Here's my question:
Is it possible, using the "onkeydown" function to code a page so that when the visitor hits "A" it opens page A, "B" page B, etc?

If yes, how?

I'll give you more information: I've got a pop-up on my site that looks like an MS-DOS application and there's links on the page called (O)PEN , (C)LOSE , (P)RINT , E(X)IT... I would like that hitting "O" really opens a new page, hitting "C" link to the first page, hitting "P" actuallu prints the page and hitting "X" closes the window...

Thanx for your help!

nkaisare
10-21-2003, 02:47 PM
You can use "accesskeys" instead of javascript solution. The use has to type [Alt]-[Key]-[Enter] in IE or [Alt]-[Key] in NS to make it work.
http://www.w3.org/TR/html4/interact/forms.html#adef-accesskey

nash
10-22-2003, 06:53 AM
I'd like it work without using the [alt] or [ctrl] keys... Is it possible?