Accessibility
Morse Code Assistive Input
Morse code assistive input
A practical guide to designing for Morse code input as an accessibility method: timing, switch hardware, dot-dash translation, command flows, feedback, and error recovery.
Detailed guidance for single-switch access, text entry, calibration, and accessible UI behavior.

What Morse code means in accessibility
Morse code is often remembered as a radio or telegraph system, but in accessibility it can be a compact input language. A person can produce text and commands with one reliable action, two reliable actions, or a timing-based switch. This provides a robust alternative to complex multi-finger movements, satisfying WCAG 2.5.1 (Pointer Gestures) by ensuring operation does not require path-dependent or multipoint gestures.
In product design, Morse code should be treated as an access method, not a novelty. The interface must make timing adjustable, feedback immediate, correction easy, and focus movement predictable. The goal is not to make everyone memorize Morse. The goal is to support the users who already rely on it or can learn it because it matches their motor ability.
The timing model
Morse input depends on relative duration. The dot is the base unit. A dash is longer. Pauses separate parts, letters, and words. Assistive software should let the user define what short and long mean for their body, hardware, fatigue level, and environment.
Dot
1 unit
A short press or short signal.
Dash
3 units
A longer press, usually three times the dot length.
Between parts
1 unit
The short pause between dots and dashes inside one character.
Between letters
3 units
A pause long enough to commit the character.
Between words
7 units
A longer pause used to insert a word space.
Timing Calibration
Tap and hold the switch, or press the Spacebar key inside the page.
Letter examples
These examples use international Morse code. In a real assistive product, the same input layer may also expose predictions, shortcuts, custom phrases, or command macros to reduce effort.
How a person actually uses it
A practical Morse flow starts with calibration. The user presses the switch a few times so the software can estimate dot length, dash threshold, pause tolerance, and accidental bounce. After that, each press updates a visible and audible buffer. When the letter timeout passes, the buffer commits to a character. The user can continue typing, accept a word prediction, delete the last character, or switch into command mode.
Single-switch hold duration
The same switch creates both dot and dash. A short press becomes a dot; a longer press becomes a dash. The software must calibrate timing so it matches the user, not the other way around.
Two-switch dot and dash
One switch sends dots and the other sends dashes. This reduces timing pressure, but it requires reliable access to two controls.
Auto-scan with confirm switch
The interface scans through characters, groups, or predictions. The user activates one switch to select the highlighted target.
Keyboard Morse
Some users map dot and dash to regular keyboard keys, such as period and hyphen, then rely on software to translate patterns into text.
Realistic interaction examples
Morse switch timing calibration React hook
The core challenge of Morse switch input is timing capture. Below is a complete, copy-pasteable custom React hook that captures key/switch click duration thresholds to translate signals into dot-dash buffers dynamically:
// React hook useMorseInput for custom switch events
import { useState, useEffect, useRef } from "react";
export function useMorseInput(dotThreshold = 200, letterTimeout = 1000) {
const [buffer, setBuffer] = useState("");
const [committedText, setCommittedText] = useState("");
const pressStart = useRef(null);
const commitTimer = useRef(null);
const handleSwitchDown = () => {
if (pressStart.current) return;
pressStart.current = Date.now();
if (commitTimer.current) clearTimeout(commitTimer.current);
};
const handleSwitchUp = () => {
if (!pressStart.current) return;
const duration = Date.now() - pressStart.current;
pressStart.current = null;
const signal = duration <= dotThreshold ? "." : "-";
setBuffer((prev) => prev + signal);
commitTimer.current = setTimeout(() => {
setBuffer((currentBuffer) => {
if (currentBuffer) {
// Trigger decoding translation here
setCommittedText((msg) => msg + decodeMorse(currentBuffer));
}
return "";
});
}, letterTimeout);
};
return { buffer, committedText, handleSwitchDown, handleSwitchUp };
}Design requirements for Morse input
Let users set dot duration, dash threshold, letter timeout, repeat delay, and switch debounce.
Provide an always-visible preview of the current dot-dash buffer before it commits.
Offer undo as a first-class action because switch input errors are expensive to correct.
Never make timeout the only way to finish a character. Provide an optional commit action when possible.
Use sound, haptics, and visual feedback independently so the user can choose the channel that works.
Do not require pointer precision. All controls must be reachable by keyboard, switch, or scanning.
Support command mode separately from text mode to prevent accidental destructive actions. Avoid single-key shortcuts unless they can be remapped or disabled (WCAG 2.1.4 Character Key Shortcuts).
Persist calibration settings per user profile and respect reduced-motion preferences.
Recommended input settings
Defaults should be gentle and adjustable. A fast expert user may want short timeouts; a new or fatigued user may need slower timing and stronger feedback. Store these settings and make them easy to export or reset.
Common mistakes
Fixed timing only
A single dot duration will fail users with different movement speed, tremor, fatigue, or hardware latency.
No visible buffer
Users need to know whether the system has collected dot, dash, letter, or command input before it commits.
Hard-to-reach correction
Backspace, undo, and clear must be available through the same access method as text entry.
Motion-heavy scanning
Fast animation or large moving highlights can cause cognitive load. Keep scan states clear and stable.
Destructive command ambiguity
Command mode needs confirmation for actions such as delete, send, pay, submit, or sign out.
Testing checklist
Try the flow with one switch only, then with two switches if the product supports it.
Slow the timing down and confirm the interface still feels stable and predictable.
Increase the timing speed and confirm no false double input appears from switch bounce.
Confirm every command can be reached without a pointer or touchscreen gesture.
Verify speech, haptic, and visual feedback can be enabled or disabled independently.
Test command mode with destructive actions and require confirmation when risk is high.
What good support feels like
Good Morse support feels calm. The system waits long enough, confirms each signal clearly, offers fast correction, and never punishes the user for a different rhythm. It should be possible to write, navigate, correct, submit, and cancel with the same access method from start to finish.