...

View Full Version : How to assign keys to links



Shindig
08-10-2004, 10:13 AM
I was wondering how to make keyboard keys correspond to certain links on a webpage. For example if there was a "maze" with the folowing screen:

North
West | East
South

(Imagine North, South, West, and East as links taking you to their respective direction)

How would I program it so that if I pressed the up arrow on my keyboard it would take me north, left arrow would take me west, etc.

I've looked in numerous places, asked many people but no one can produce an answer, it would be great if one of you can.

PS. This is for IE 6

glenngv
08-10-2004, 12:52 PM
What do you mean by "take me north, west, ..."?
Do you mean that when you press the UP arrow, the page would automatically go to the location specified in the North link? Or just focus on the North link?

Shindig
08-10-2004, 04:50 PM
What I mean is, if I pressed the up arrow it would produce the same effect as actually clicking on north with the mouse. Same with the other directions and the other arrow keys.

sad69
08-10-2004, 05:58 PM
Can you provide a picture of what you're saying? Like a literal GIF or JPG or something -- I still don't get it, it's too ambiguous.

Sadiq.

Roy Sinclair
08-10-2004, 06:40 PM
http://www.codingforums.com/showthread.php?t=8044

See the script in the second to last post in this thread , it's a nice utility that you can use to find information you'll need to make the script you want and also serves as an example of how to capture those keyboard events and respond to them.

Shindig
08-10-2004, 07:12 PM
Can you provide a picture of what you're saying? Like a literal GIF or JPG or something -- I still don't get it, it's too ambiguous.

Sadiq.

here's a picture

glenngv
08-11-2004, 01:53 AM
What happens if you click North, East, West and South links?

Roy Sinclair
08-11-2004, 09:14 PM
While everyone else seems to be mystified by your request, have you even looked at my response? Did it make any sense to you?

My understanding, just like the arrow keys cause your character to move through the landscape in a computer game you want to use the arrow keys to navigate through web pages.

The script I liked to shows how to capture keyboard events (like pressing an arrow key) and as the script is currently written (by Dave Clark who used to be a regular here and is still missed by those of us who remember him) also displays the internal "keycode" for the key which is pressed. That makes the script a utility which can be used to find the keycodes you'll want to watch.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum