• Success Criterion 2.1.4
  • Conformance level A
  • W3C reference F99

Single-Letter Keyboard Shortcut With No Way to Turn It Off

2.1.4 — Character Key Shortcuts

Scenario

Setting

A news outlet's article page

What’s wrong

Single-letter keyboard shortcuts (like 'j', 's') can't be turned off or changed — speech-input users trigger them accidentally while dictating.

Example

document.addEventListener('keydown', (e) => {
  if (e.key === 'j') goToNextArticle();
  if (e.key === 'k') goToPreviousArticle();
  if (e.key === 's') saveArticle();
});
// fires everywhere on the page, with no settings option to disable it

Why it matters

A reader dictating a comment with speech-input software says a word containing "s" or "j" and the page jumps to a different article mid-sentence.

How to test

Press a single-letter/number/symbol shortcut while focus is on ordinary content: check Settings for a way to turn it off or remap it — if none exists, it fails.

How to fix

WCAG 2.1.4 requires single-character shortcuts to be turned off or remapped; add a persistent, discoverable settings toggle.

let shortcutsEnabled = true; // exposed via a Settings > Shortcuts toggle, stored per user
document.addEventListener('keydown', (e) => {
  if (!shortcutsEnabled) return;
  if (e.target.matches('input, textarea, [contenteditable]')) return;
  if (e.key === 'j') goToNextArticle();
  if (e.key === 'k') goToPreviousArticle();
  if (e.key === 's') saveArticle();
});

Outcome

A reader dictating a comment finishes their sentence without the page jumping away underneath them.

Who is affected

Speech-input users and users with hand tremors who trigger keys unintentionally lose control of the page without warning.

Learn more