Skip to content
2.1.4 · Level A · WCAG 2.1 · Operable → Keyboard Accessible

Character Key Shortcuts

A keyboard shortcut made of a single letter, number or punctuation key, with no modifier, can be turned off, remapped to include a modifier, or is only active while the relevant control has focus.

Why it matters

A speech-recognition user dictating an email says a word, the software types it, and every letter fires a shortcut: the message is archived, starred and deleted before the sentence is finished. A single-key shortcut that cannot be disabled makes the app unusable with speech input.

Needs manual testing

Shortcuts live in JavaScript keydown handlers, which no automated rule inspects. Press each letter and number key on a page with nothing focused and note what happens, then check the settings for a way to disable or remap any that fire.

Fails

<script>
  document.addEventListener("keydown", (e) => {
    if (e.key === "e") archiveMessage();
    if (e.key === "#") deleteMessage();
  });
</script>

Typing an "e" anywhere on the page archives the current message. There is no way to switch it off.

Passes

<script>
  document.addEventListener("keydown", (e) => {
    if (!settings.shortcutsEnabled) return;
    if (e.target.closest("input, textarea, [contenteditable]")) return;
    if (e.key === "e") archiveMessage();
    if (e.key === "#") deleteMessage();
  });
</script>
<label><input type="checkbox" id="shortcuts" checked> Enable single-key shortcuts</label>

Shortcuts are ignored inside text fields and can be turned off entirely in settings. Requiring a modifier key, such as Ctrl, is the other acceptable fix.

Openwell finds violations like this one across your whole site, clusters them by the component that caused them, and generates a fix that's re-validated before you see it.

Scan your site free
WCAG 2.1.4 Character Key Shortcuts — what it requires and how to fix it — Openwell