The problem no one expects during a typing test
You’re cruising through a test when, suddenly, “you” becomes “zou.” That isn’t your accuracy—it’s your OS quietly switching keyboard layouts. It happens more often than you’d think: Windows updates can re‑add layouts (e.g., German) without showing them clearly in Settings, and Linux desktop updates sometimes reset input sources to US. Real people keep reporting this, including Windows 11 users whose removed German layout returns after updates and doesn’t even appear in the normal UI, and Manjaro Linux users whose layouts flip to English (US) on reboot or logout. (learn.microsoft.com)
Why does this keep happening (still) in 2026? On Windows, keyboard switching hotkeys (Alt+Shift, Win+Space) and per‑app input settings make layout changes easy to trigger—and sometimes sticky across sessions. (support.microsoft.com) On Linux, upstream keyboard definitions ship via xkeyboard‑config, and recent releases integrated updated German DIN 2137 layouts and other changes that can ripple through distros and desktop environments. (xkeyboard-config.freedesktop.org) And yes, Windows 11 24H2 added the “German extended (E1/E2)” layouts too, reflecting those DIN updates. (en.wikipedia.org)
This matters for test integrity. In the United States alone, about 22% of people age 5+ speak a language other than English at home—multilingual typists are common, and many keep multiple layouts installed. (census.gov) When the OS flips mid‑test, accuracy tanks through no fault of the user.
A plan for typing tests: detect, warn, and lock
Here’s a practical, user‑friendly design any web‑based typing test can adopt:
1) Auto‑detect from early keystrokes
You cannot rely on the OS to tell you the active layout, but the browser gives two powerful signals:
- KeyboardEvent.code = the physical key position (unchanged by layout)
- KeyboardEvent.key = the produced character (changed by layout)
If code says the user pressed the “KeyY” position but key yields “z,” you almost certainly have a QWERTY↔QWERTZ mismatch. Use 10–30 characters to build confidence and flag a probable layout. (developer.mozilla.org)
For browsers that support the Keyboard Map API, you can directly query the current mapping: `await navigator.keyboard.getLayoutMap()` returns the characters produced by each physical key (experimental, HTTPS required). Use it to resolve or confirm a mismatch instantly. (developer.mozilla.org)
Heuristics that work well in practice:
- High‑signal pairs: Y↔Z, “;”↔“ö/ä”, “/”↔“-” (depending on national layouts). One or two wrong‑way hits can be noise; three to five within the first 20–40 characters is a strong indicator.
- Dictionary plausibility: If many common English bigrams (you, they, the) become improbable strings (zou, tgez), raise suspicion.
- IME awareness: Ignore input while a composition is active (East Asian IMEs) to avoid false alarms.
If your test shows target text, compare expected vs received characters by physical position: when the expected character at the “KeyY” position keeps arriving as “z,” you’re seeing a layout swap—not just typos.
2) A friendly, immediate warning
If detection confidence crosses a threshold, show a non‑blocking toast: “We think your OS switched layouts to QWERTZ. Want to lock to QWERTY for this test?” Include a small keyboard icon the user can click anytime to review the detected layout and switch.
3) One‑click “Layout Lock”
Layout Lock forces a consistent mapping for the rest of the test. Implementation idea:
- When enabled, ignore `event.key` and synthesize characters from `event.code` using a fixed map (e.g., a QWERTY table). That way, even if the OS flips, the output remains stable. (developer.mozilla.org)
- If `getLayoutMap()` is available, you can instead snap to whatever the user is currently using—“Lock to current layout”—and keep it consistent even if the OS toggles mid‑run. (developer.mozilla.org)
Recovery UX: If the user toggles Lock off, return to normal behavior and rerun detection quietly.
4) Integrity guardrails
- Mark runs with a “layout anomaly” event if a flip is detected mid‑test; let users discard that run.
- Offer a pre‑test keyboard check: a tiny “Type Y Z y z” widget that highlights mismatches.
- Expose a clear manual selector (QWERTY, QWERTZ, AZERTY, etc.) for edge cases.
Why QWERTY↔QWERTZ bites so hard
The Y/Z swap is enough to implode accuracy. QWERTZ is standard in Germany, Austria, and much of Central Europe, and differs from QWERTY primarily by that swap (plus punctuation/umlauts). If your OS silently adds or prioritizes German layout, “Y” keystrokes start producing “Z.” (en.wikipedia.org)
On Linux, upstream changes also keep rolling out. Recent xkeyboard‑config releases adjusted German E1/E2 per DIN 2137‑1:2023—changes that land via distro updates and can alter behavior or defaults. (xkeyboard-config.freedesktop.org) And distros sometimes ship updates that reset input sources—for example, Manjaro users reported layouts reverting to US after updates/logouts. (forum.manjaro.org)
On Windows, the combination of hotkeys (Alt+Shift), per‑app input method, and language pack behavior makes it easy for a layout to reappear or take focus. Multiple reports show removed layouts returning after Windows Update (e.g., German reappearing and invisible in Settings). (support.microsoft.com)
Practical fixes you can recommend to users
- Windows
- Change or disable layout‑switch hotkeys if they’re accidental triggers; by default Alt+Shift cycles layouts. (support.microsoft.com)
- In Settings > Time & Language > Typing > Advanced keyboard settings, either pick a default input method override or turn off “Let me use a different input method for each app window” if switching feels random. (learn.microsoft.com)
- If a removed layout keeps returning after updates (and isn’t visible in the normal UI), point users to the issue as a known Windows 11 behavior and suggest a reboot after cleanup or deeper remediation. (learn.microsoft.com)
- Linux (GNOME/Wayland flavors common in 2025–2026)
- Verify the desktop’s Input Sources and any IME framework (IBus/Fcitx5). Some Manjaro users found extra input method packages or extensions interfered with saved layouts. (forum.manjaro.org)
- After big distro updates, re‑check the selected layout and console/XKB settings; upstream xkeyboard‑config releases can change defaults or symbols (notably for German E1/E2). (xkeyboard-config.pages.freedesktop.org)
Implementation checklist for developers
- Collect both `event.key` and `event.code`; compute mismatch ratios on high‑signal keys.
- Use `navigator.keyboard.getLayoutMap()` when available (feature‑detect; HTTPS only; experimental). Fall back to heuristics elsewhere. (developer.mozilla.org)
- Provide a visible Layout Lock toggle with two modes: “Lock to QWERTY map” (code→QWERTY) and “Lock to current map.” (developer.mozilla.org)
- Respect IME composition events; don’t run detection while composing.
- Log “layout anomaly” telemetry to help users and support diagnose score dips.
Bottom line
OS layout churn isn’t going away: Windows keeps adding/reshuffling layouts via updates, and Linux picks up changes from upstream specs like DIN 2137 through xkeyboard‑config. (learn.microsoft.com) Your typing test can protect users and preserve fairness by auto‑detecting mismatches early, warning gently, and offering a one‑click Layout Lock that keeps the run consistent—no matter what the OS does mid‑test.