This is an archive of an inactive wiki and cannot be modified.

Access keys

This technique gives a possible implementation for the CategoryBpAccessKeys using XHTML.

What are access keys?

Access keys are shortcuts that can be used for common parts of a document. For example, if you have a large site, and there is a link to a detailed site map at the bottom of each page, it is useful to be able to access that map as quickly as possible. HTML provides the accesskey attribute to make this possible, for links (the a element) and form controls.

Using accesskey

Implementations Steps:

(Using only numbers in an ordered list and only covering links is a horrible hack, but it works on almost any system that supports accesskey however broken, and doesn't actively cause problems for good implementations. See also CategoryBpDeficiencies).

Code sample 1

<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>List of links</title><head>
<body>
<h1>Using Acceskeys</h1>

<p>Put the main page content here, so the user doesn't have to skip past the navigation in order to use it. The accesskeys are, anyway, meant to be common and important things, so the user will very quickly learn them and not need to scroll down to the list to use them</p>

<ol>
 <li><a href="one" accesskey="1">One</a></li>
 <li><a href="two" accesskey="2">Two</a></li>
 <li><a href="three" accesskey="3">Three</a></li>
 <li><a href="four" accesskey="4">Four</a></li>
 <li><a href="five" accesskey="5">Five</a></li>
</ol>
</html>

Some issues...

Mobile devices often have fewer keys than most desktop web browsers (but more than some kiosks and other web-enabled systems). Typically, they will have the numbers 0 - 9 available. Browsers should (but sometimes don't) make sure that they can offer access through some mechanism to links or form controls that specify an accesskey which is not available.

Activation of accesskeys is highly browser-dependent. Therefore it is not a good idea to try and provide detailed instructions on how to activate them - good implementations will make that clear to the user, as they may have re-mapped the keys specified to suit the device's capabilities. It is not a bad idea to provide, in information about the site, a list of the keys used, for users whose browser is not helpful but does support accesskeys. One such example is the UK government standard accesskeys, a standard set of accesskeys across a large number of sites.

@@ Is it possible to make two lists, one that starts at 4, so the first one has the "top 3 links" and the second has the other nine?

@@ On the desktop web, the rel attribute should be used to provide quick access. But I don't know if there is any useful implementation for it in the mobile world... needs some thinking.


CategoryPhp CategoryXhtml

Contributions to this wiki are governed by the W3C policies for Contribution to W3C' wiki on Mobile Web.