Checking websites for single character key shortcuts (2.1.4) is not easy

Note: This post is older than two years. It may still be totally valid, but things change and technology moves fast. Code based posts may be especially prone to changes...

(Read 436 times)

How do you test for something that can be only possible in certain conditions? Well, best way to do this kind of testing is to ask developers and others that were involved in the feature specifications.

I’ve recently had to do a full audit of a website and was reminded of the fact that sometimes auditing some parts of web content accessibility guidelines (WCAG) can be difficult for external auditors with no direct contact with developers.

One of those success criteria is Success Criterion 2.1.4: Character Key Shortcuts (opens in new window) that explains: “If a keyboard shortcut is implemented in content using only letter (including upper- and lower-case letters), punctuation, number, or symbol characters, then at least one of the following is true: Turn off, Recap or Active only on focus”.

My first hunch was to check for the “accesskey” attributes on the page, but those are not affected here as they need to include modifier keys (like for example “Alt + Shift + accesskey”).

My second guess was that we can try to press all keys on the keyboard and check for effects. That would unfortunately not be enough as shortcuts might only be working in special situations that would require focus on distinct elements on the page.

Could we maybe test this automatically, with some JavaScript? Well there are some attempts to do it, like for example 3needs.org’s Character key shortcut test page (opens in new window), but as mentioned – it is not enough to only press all keys available to be certain that the site is passing or failing the success criterion.

Communication is key

A bit of a word play here – single key shortcuts and “communication is key” – but it really is. We can not be totally certain about the implementation without having access to source code – original, not minified and not obfuscated – JavaScript. That alone is also not very efficient – imagine reading all of the different parts that are not related to keyboard shortcuts – so as mentioned – communication is key.

We should be able to ask developers about it and check if they are aware of single key shortcuts. Their answer is based on trust and please be aware that some third party scripts installed on the site could also include keyboard shortcuts. So checking it with third party script providers would probably also make sense.

Author: Bogdan Cerovac

I am IAAP certified Web Accessibility Specialist (from 2020) and was Google certified Mobile Web Specialist.

Work as digital agency co-owner web developer and accessibility lead.

Sole entrepreneur behind IDEA-lab Cerovac (Inclusion, Diversity, Equity and Accessibility lab) after work. Check out my Accessibility Services if you want me to help your with digital accessibility.

Also head of the expert council at Institute for Digital Accessibility A11Y.si (in Slovenian).

Living and working in Norway (🇳🇴), originally from Slovenia (🇸🇮), loves exploring the globe (🌐).

Nurturing the web from 1999, this blog from 2019.

More about me and how to contact me: