Character Key Shortcuts: Off, Remap or Focus
Also called: Single-key shortcuts, Single character shortcuts, Keyboard shortcuts
Definition
Character key shortcuts is WCAG success criterion 2.1.4. If a keyboard shortcut uses only letter, punctuation, number or symbol keys, users must be able to turn it off, remap it to include a non-printable key such as Ctrl or Alt, or it must be active only while its component has focus.
Character key shortcuts are shortcuts that fire on a single printable key – "s" for search, "j" for next, "?" for help. They save time for some people and cause chaos for others: speech input users dictate words that are read as strings of letters, and a stray keystroke can archive an email. WCAG 2.1.4 requires a way out.
What it means
WCAG 2.1.4 Character Key Shortcuts is a Level A criterion in WCAG 2.2. It applies when a keyboard shortcut uses only letters (upper or lower case), punctuation, numbers or symbols. Then at least one of these must be true:
| Option | What it means |
|---|---|
| Turn off | A setting switches the shortcut off |
| Remap | The shortcut can be changed to include a non-printable key such as Ctrl or Alt |
| Active only on focus | The shortcut only works while its component has focus |
The number of physical keys does not matter: Shift+/ for "?" still counts as a character shortcut, because it produces a printable character. Sequences such as "g" then "a" are covered too. Not covered: listboxes and drop-down menus, where typing a letter jumps to an option, and access keys.
W3C's example shows why it matters: in a webmail app, someone using speech input says "Hey Kim" to a coworker, and the letters trigger archive and mute commands. Keyboard users with dexterity challenges hit keys by accident – a press of "s" moves the focus to the search field and they lose their place. Shortcuts with Ctrl or Alt rarely fire by accident. Single keys also must not get in the way of keyboard navigation or a screen reader's own reading keys.
Examples
<label>
<input type="checkbox" id="shortcuts-on" checked>
Use single-key shortcuts (j / k to move, s to search)
</label>
<script>
document.addEventListener('keydown', (e) => {
const on = document.getElementById('shortcuts-on').checked;
const typing = e.target.closest('input, textarea, select, [contenteditable]');
if (!on || typing || e.ctrlKey || e.metaKey || e.altKey) return;
if (e.key === 's') { e.preventDefault(); document.getElementById('search').focus(); }
});
</script>The checkbox lets people turn every single-key shortcut off at once. The handler also ignores keys typed into form fields and combinations with modifier keys.
Offer a setting to switch character shortcuts off, use Ctrl, Alt or Cmd combinations for global shortcuts, limit single keys to the focused widget, and list the shortcuts on a help page.
Bind global actions such as delete or archive to one letter, react to keys typed in form fields, or hide the off switch where nobody finds it.
How to check character key shortcuts
Questions
What is a character key shortcut?
A keyboard shortcut that uses only printable characters – letters, numbers, punctuation or symbols – without Ctrl, Alt or Cmd. "j" for next item or "/" to open search are typical examples.
Are Ctrl and Alt shortcuts covered by 2.1.4?
No. A shortcut that includes a non-printable modifier key such as Ctrl or Alt does not fall under 2.1.4. Remapping a single-key shortcut to such a combination is one way to meet the criterion.
Do I need a settings page for shortcuts?
Not if the shortcut is only active while its component has focus, for example arrow and letter keys inside a focused grid. Global single-key shortcuts need a way to turn them off or remap them.
Why are single-key shortcuts a problem for speech input?
Speech input software can send spoken words as letters. Each letter may fire a shortcut, so one sentence can trigger a whole series of commands.
How do I check my website for keyboard problems?
Character shortcuts need a manual test by pressing keys. The free WCAG scanner helps with related issues such as buttons and links without a name.
Related terms
Keyboard Navigation: WCAG 2.1.1 Explained
Keyboard navigation means that every function of a website can be reached and operated with a keyboard alone – usually with Tab, Shift+Tab, Enter, Space and the arrow keys. WCAG 2.1.1 requires it at Level A.
Read definition: Keyboard Navigation: WCAG 2.1.1 ExplainedFocus Order: Logical Tab Order Explained (WCAG 2.4.3)
Focus order is the sequence in which interactive elements receive keyboard focus when a user presses Tab. WCAG 2.4.3 requires that this sequence preserves the meaning and operability of the page.
Read definition: Focus Order: Logical Tab Order Explained (WCAG 2.4.3)Keyboard Trap: WCAG 2.1.2 Explained and Fixed
A keyboard trap is a part of a page that keyboard focus can enter but not leave using the keyboard alone. WCAG 2.1.2 No Keyboard Trap forbids it at Level A.
Read definition: Keyboard Trap: WCAG 2.1.2 Explained and FixedScreen Reader: How It Reads Websites and What It Needs
A screen reader is assistive software that reads the content and controls of a screen aloud or outputs them on a braille display. It relies on the names, roles and states that a website exposes through the browser's accessibility tree.
Read definition: Screen Reader: How It Reads Websites and What It Needs