leiaah 0 Report post Posted February 21, 2006 Is there a way to make use of the keyboard when togging html links? I'm doing a project and it would be nice if the user won't be too mouse-dependent. He will have the option of using the keyboard as well. I'm thinking if the user does a particular keypress (CTRL + LETTER maybe?) the link will be "clicked". This is probably a stupid question but if anyone knows a way it would be so fantastic! Thanks. Share this post Link to post Share on other sites
jlhaslip 4 Report post Posted February 21, 2006 Use the Tab key to set the focus on links without using the mouse. 'Tab order' can be by the default order in which they appear in the code or as determined by the page author re-arranging the Tab order with "Tabindex=". <a href="blah.com" tabindex="3">Blah Page 3</a><a href="blah.com" tabindex="2">Blah Page 2</a><a href="blah.com" tabindex="1">Blah Page 1</a>And then 'return' or 'Enter' to activate the link. Share this post Link to post Share on other sites
wild20 0 Report post Posted February 21, 2006 If you don't mind using Javascript, there is also a way to make it so the user is directed toward a certain page when a certain button is clicked. You could set this up by a link and give the user the key commands. Javascriptkit.com or javascriptsource.com I think those two are the best ones. Look under navigation. Hope it helps. Share this post Link to post Share on other sites
rvalkass 5 Report post Posted February 21, 2006 I think what you are looking for is called Access Keys. It seems to do exactly what you want, the user pushes Ctrl + Letter on the keyboard and it takes them to a certain link. Simply use this code: <a href="http://forums.xisto.com/no_longer_exists/; The letter you use for the access key is generally underlined in the text shown, like menus and toolbars in various programs. If you want any more on this try this article. Share this post Link to post Share on other sites
Lozbo 0 Report post Posted February 21, 2006 I believe that accesskeys works differently through browsers, for example, in order to activate the link with the given accesskey you have to press:in firefox: alt + "key"in internet explorer: alt + "key" and next "enter" to go to the linkin opera: still dont know... Share this post Link to post Share on other sites
moldboy 0 Report post Posted February 22, 2006 Here is a page I havn't tryed but it says it only works in IE and Opera (odd combination I think) but it's a start.http://www.dynamicdrive.com/dynamicindex5/button1.htm Share this post Link to post Share on other sites
leiaah 0 Report post Posted February 22, 2006 I think what you are looking for is called Access Keys. It seems to do exactly what you want, the user pushes Ctrl + Letter on the keyboard and it takes them to a certain link. Simply use this code: <a href="sample.com" accesskey="s"><u>S</u>ample.com</a>The letter you use for the access key is generally underlined in the text shown, like menus and toolbars in various programs. If you want any more on this try this article. Thanks rvalkass. It works except that you have to press enter after hitting CTRL + Access Key but it's okay. Thanks again. Share this post Link to post Share on other sites
Tyssen 0 Report post Posted February 22, 2006 Thanks rvalkass. It works except that you have to press enter after hitting CTRL + Access Key but it's okay. Thanks again. It's alt + access key actually and it's perfectly acceptable that someone should have to press two keys for site navigation, I mean, that's the way 99% of all program functions work when not using the mouse. About the only programs I can think of where pressing a single key produces a result is graphics programs when selecting different tools, so for most people, pressing a single key and suddenly being take to a different page would actually be unnatural and unexpected behaviour. Share this post Link to post Share on other sites
Lozbo 0 Report post Posted February 28, 2006 Yes, i support Tyssens argument, although i could point to GMail as a site that uses only a single key navigation feature... (its turned on by default, so you must notice it and turn it on to make it work, so it can not be as 'unexpected' as a site which offers no warning).As for a consistent and cross browser way to show a hint to users that they can navigate their site through the key board, I dont know if it exist, but would point to this ALA article that offers nice tips about accesskeys:http://forums.xisto.com/no_longer_exists/ Share this post Link to post Share on other sites