- Success Criterion 2.1.4
- Conformance level A
Keyboard Shortcut That Fires Even While Typing in a Field
2.1.4 — Character Key Shortcuts
Scenario
Setting
A pharmacy app's prescription-refill form
What’s wrong
Shortcut active while focus is in text inputs (typed letters trigger actions).
Example
document.addEventListener('keydown', e => { if (e.key === 's') save(); }); Why it matters
Speech-input users and people who press keys accidentally.
How to test
Focus a text input field and type a letter that's also a shortcut elsewhere on the page: if the shortcut fires instead of (or in addition to) the letter being typed, it fails.
How to fix
The single-key shortcut must be turn-off-able, remappable to include a modifier key, or active only when its control has focus. document.addEventListener('keydown', e => { if (e.ctrlKey && e.key === 's') save(); }); Single-character shortcuts with no modifier key collide with screen reader and speech-input commands.
Outcome
On a pharmacy app's prescription-refill form, this barrier is gone for speech-input users and people who press keys accidentally — they can complete the task without hitting this wall.
Who is affected
Speech-input users and people who press keys accidentally.
Learn more
- Understanding Understanding document (opens in a new tab)
Related scenarios
- Single-Letter Keyboard Shortcut With No Way to Turn It Off
- Global Single-Key Shortcut That Fires During Speech Dictation
- Library’s Default Hotkeys Shipped With No Settings Toggle
- Shortcut Remapping That Doesn’t Allow Modifier Key Combinations
- Shortcut Toggle Setting That Resets on Every Page Load
- Shortcut Off-Switch Hidden Behind the Very Barrier It Fixes