logo

Keyboard Shortcuts in the Browser

Over four years ago (bloody hell!) I wrote an article called Buttons with Keyboard Shortcut. At the time this was yet another IE-only solutions. While the <button> element was a W3C idea it was Microsoft who first adopted it. It's only now that we can safely use it in web applications, knowing that most browsers support it.

As well as talking about buttons that article talked about keyboard shortcuts using the accesskey attribute. I've been using these shortcuts ever since. This site uses them too. Brian Green noticed the underlined S in the label for the search box, realised Alt+S takes focus there and mailed to say he liked it. Until then I'd presumed everybody has read all of my articles (there's less than 200!) and so knew about this trick. Obviously not.

You have to be careful when using shortcuts though. The trick is to not over-ride the browser's default shortcuts for its menu items. For the main browsers this rules out B, F, E, G, V, A, T, H & D. It's easy enough to avoid using these characters, but what about browsers in countries that don't speak English? It's hard to avoid all conflicts.

The easy way round this is to use numbers. You can get back to this site's homepage at any time by pressing Alt+1 (Ctrl+1 in Safari/Mac). Hover over the codestore logo and there's a hint to this effect in the tooltip. I could easily apply this to my navigation bar at the top of each page. The Blogs link could be Alt+2, Articles Alt+3, Sandbox ALT+4 etc etc. The same method could be applied to almost all sites.

Using buttons and shortcut keys is now safer than it's ever been (although using the accesskeys for the buttons in that article crashes Safari) and I recommend their use. Just be careful how you use shortcut keys!

Comments

    • avatar
    • Bernard Devlin
    • Fri 20 May 2005 05:09

    Jake, something weird happening with the logo on your home page. In Mozilla 1.5 (win32) it is not displaying any logo at all. In IE 6 it is displaying the logo but mousing over it makes it disappear for a second or so (and be replaced by a white box)

    • avatar
    • Jake Howlett
    • Fri 20 May 2005 05:15

    Bernard. The IE thing is a bug whereby it doesn't cache background images. Not sure what Mozilla is missing the logo. Try a refresh?

  1. Not sure if you've seen this script or are using it.

    {Link}

  2. malalai

  3. dsdadvcvfbvsssssssb

    cvbv

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Fri 20 May 2005

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

Elsewhere

Here are the external links posted on the same day.

More links are available in the archive »

More Content