Operable · Level A · 2.1.4
Character Key Shortcuts
A single-letter keyboard shortcut with no modifier key (pressing just "s" to jump to search, no Ctrl or Alt involved) has to be turnable-off, remappable to include a modifier key, or only active while the relevant component has focus — because a bare-letter shortcut fires by accident for people who don't mean to trigger it.
- Motor
- Cognitive
How to recognize it
Look for single-character shortcuts — one letter, number, or symbol key, with no Ctrl/Alt/Cmd — that trigger an action anywhere on the page, and check whether there's any way to turn them off, remap them, or whether they're scoped to only fire when a specific element has focus. This mainly breaks speech-input software: someone dictating text has their words interpreted letter by letter as they speak, and if the page is also listening for bare keystrokes as shortcuts, ordinary dictation accidentally triggers page actions the user never meant to invoke. It also affects keyboard users prone to accidentally hitting keys, and people with cognitive disabilities who benefit from being able to remap shortcuts consistently instead of every site inventing its own bare-letter scheme.
How to fix it
Prefer shortcuts that require a modifier key (Ctrl, Alt, Cmd) — those don't trigger accidentally from ordinary typing or speech input. If a single-character shortcut is genuinely wanted (common in web apps for power-user speed), give users a setting to turn it off or remap it to include a modifier, or scope it so it only activates when a specific component has keyboard focus rather than firing globally across the whole page.
Example
Avoid
document.addEventListener('keydown', (e) => {
if (e.key === 's') openSearch();
});
/* bare 's' fires globally, no way to disable or remap it */Prefer
document.addEventListener('keydown', (e) => {
if (e.ctrlKey && e.key === 's') openSearch();
});
/* requires a modifier key, won't fire from ordinary typing or dictation */searchInput.addEventListener('keydown', (e) => {
if (e.key === '/') focusSearch();
});
/* bare key, but only active while this specific element has focus */