The Unixdaemon site is undergoing some design changes as and when i get time. Surprisingly its gone from being a short set of links pointing to a few bits to code to something that actually gets unique visitors every day; and its not just my mum! On the left of the home page I’ve added a small set of navigation links and while working through the CSS i thought I’d try adding access keys.
First some basics, an accesskey works in the same way as the menu shortcuts in the native OS, you use a meta key (typically Alt on Windows and Ctrl on Macs) and press another key to access a function or menu. The code for setting this up is remarkably simple, to make a meta-h combination move you to the home page you’d use code like this in your page:
<a href="index.html” accesskey="h”>Home</a>
This leads me to the problems, firstly not all browsers support them. This is the easiest to solve, wait long enough and everything in mainstream usage will accommodate them. Secondly there is the issue of precedence, your accesskeys may be overridden by the browser or OS. The reverse is also true, if you choose certain letters such as the ‘h’ presented above, you lose the ability to use shortcut keys to access browser functionality. In IE you’ll no longer be able to use Alt-h to access the Help menu.
If you want to dig a little deeper into access keys these two links cover the basics and more advanced topics respectively.