Skip to main content
Perceivly: Perceivly home

2.1.4 Character Key Shortcuts

Level A · added in WCAG 2.1

Shortcuts that use only a letter, number, punctuation or symbol key must be possible to turn off or remap. Otherwise, they must work only when their component has focus.

Who it helps

Speech input users dictate words, and each spoken letter can fire a single-key shortcut by accident. Keyboard users with tremors or motor disabilities also hit keys by mistake and trigger actions they did not intend.

How to meet it

Examples

Fails:Pressing s anywhere on the page jumps to search, with no way to turn it off
<script>
  document.addEventListener("keydown", (e) => {
    if (e.key === "s") {
      e.preventDefault();
      document.getElementById("search").focus();
    }
  });
</script>
Passes:A setting turns the shortcut off, and it never fires while typing
<label><input type="checkbox" id="shortcuts" checked> Single-key shortcuts</label>
<script>
  const toggle = document.getElementById("shortcuts");
  document.addEventListener("keydown", (e) => {
    if (!toggle.checked || e.target.closest("input, textarea, [contenteditable]")) return;
    if (e.key === "s") {
      e.preventDefault();
      document.getElementById("search").focus();
    }
  });
</script>
Passes:The shortcut needs a modifier, so it is outside the criterion's scope
<script>
  document.addEventListener("keydown", (e) => {
    if (e.altKey && e.shiftKey && e.code === "KeyS") {
      e.preventDefault();
      document.getElementById("search").focus();
    }
  });
</script>

Can a scanner detect this?

No

axe-core has no rule for shortcuts, because key handlers live in JavaScript and only show up when keys are pressed. Press letter, number and symbol keys outside form fields, and check for a setting that turns them off.

No automated rule tests this criterion. Check it by hand.

Common mistakes

Official W3C explanation of 2.1.4

Check your own page

See which automated WCAG checks your page fails, with the failing elements and how to fix them.

Enter a page address, for example example.com/shop.

Reviewed November 2, 2026