The Trouble with ACCESSKEY
Karl Dawson
That Standards Guy
The accesskey attribute
- Assigns an access key to an element.
- An access key is a single character from the document character set.
- Pressing an access key assigned to an element gives focus to the element.
- Supported by the following elements: A, AREA, BUTTON, INPUT, LABEL, LEGEND, and TEXTAREA.
- Example:
<a href="#fragment" accesskey="1">a link</a>
Link
- http://www.w3.org/TR/html401/interact/forms.html#adef-accesskey - HTML 4.01 Specification, Section 17.11.2 Access keys.
Using access keys
- Dependent on the underlying system.
- Windows: press the ALT key in addition to the access key.
- Mac: press the CMD key in addition to the access key.
Web Content Accessibility Guidelines
- Checkpoint 9.5.
- A Priority 3 checkpoint.
"Provide keyboard shortcuts to important links (including those in client-side image maps), form controls, and groups of form controls."
- Priority 3, but easy to implement.
- The UK government has a standard method of assignment detailed in section 2.4.4 of its universal accessibility checklist.
Links
- http://www.w3.org/TR/WAI-WEBCONTENT-TECHS/#tech-keyboard-shortcuts - Checkpoint 9.5.
- http://www.cabinetoffice.gov.uk/e-government/resources/handbook/html/2-4.asp - UK government universal accessibility checklist.
The problem
- Assigning a letter to an accesskey could hijack default browser functionality - and keyboard users rely on those already.
- It's something else to learn in order to use the website - a real challenge to keyboard users with a learning difficulty.
- Assign a number to an accesskey and you hijack alt keystrokes needed to input special characters not on the keyboard. (e.g.) ALT + 0233 = é
- Unacceptable in a multi-cultural society?
- Unacceptable for websites that have a global audience?
- Who knows they are there anyway?
Link
- http://www.starr.net/is/type/altnum.htm - ALT key codes and charts.
The solution
Links
- http://juicystudio.com/article/user-defined-accesskeys.php - Gez Lemon's User-defined accesskeys in PHP.
- http://juicystudio.com/article/user-defined-access-keys-aspversion.php - Gez Lemon's User-defined accesskeys in ASP.