Table of Contents
You press Q and get A. You type 2 and get @. The characters on screen don’t match your keycaps. Before you assume the keyboard is broken, understand this: the physical key and the character it produces are decoupled by software. The keyboard sends a physical position code (e.g., KeyQ). The operating system translates that into a character based on your active keyboard layout, input source, and modifier state.
This guide walks through every common cause — from a simple layout toggle to a stuck modifier key — and shows you how to isolate the issue using our Online Keyboard Tester, Key Event Tester, Stuck Key Detector, and Broken Key Detector.
Why keyboards type unexpected characters
The chain from keypress to character:
Physical press → Keyboard MCU scans matrix → Sends USB HID usage code (e.g., 0x14 = "Q position")
→ OS keyboard driver → OS input subsystem (layout engine)
→ Active layout map (US, UK, DE, FR, JP, etc.) → Character code point (U+0051 = "Q")
→ Application receives character → Renders on screen
A mismatch at any stage produces wrong characters:
| Stage | What Can Go Wrong |
|---|---|
| Keyboard hardware | Stuck modifier (Shift/Ctrl/Alt), chatter, dead key, wrong firmware map |
| OS layout engine | Wrong layout selected (US vs UK vs DE), multiple layouts active, input method editor (IME) |
| Application | Font substitution, rich-text formatting, shortcut interception |
| Browser | Focus issues, extension interference, capture mode |
Incorrect keyboard layout (most common cause)
Your keycaps say QWERTY but the OS thinks you’re on AZERTY, QWERTZ, or Dvorak.
Symptoms
Q→A(AZERTY) or'(Dvorak)Z→W(AZERTY) or;(Dvorak)M→,(AZERTY)- Numbers row produces wrong symbols:
2→"(UK) instead of@(US)
Quick test
Open Key Event Tester → press Q
event.code=KeyQ(physical position, never changes)event.key=q(US),a(AZERTY),'(Dvorak) — this is the layout output
If event.code is correct but event.key is wrong → layout mismatch, not hardware fault.
Language and input source switching
Modern OSes support multiple input sources. Accidental switching is the #1 cause of “my keyboard is broken” reports.
Common triggers
| Trigger | What Happens |
|---|---|
Win+Space (Windows) / Ctrl+Space (macOS) / Super+Space (Linux) |
Cycles input sources |
| Language bar click | Changes active layout |
| App-specific input source (macOS) | Different layout per app |
| IME activation (Chinese/Japanese/Korean) | Latin keys trigger composition, not direct characters |
| Remote desktop / VM | Host and guest layouts may differ |
Windows keyboard layout settings
Check current layout
- Taskbar → language indicator (e.g.,
ENG,FRA,DEU) → click → verifyEnglish (United States)or your desired layout is selected - Settings →
Time & Language→Language & Region→Preferred languages→ click...→Language options→Keyboards→ ensure only your desired layout is listed
Add/remove layouts
- Add:
Add a language→ select →Next→Install→Keyboards→Add a keyboard - Remove: Click
...next to unwanted layout →Remove
Shortcut to cycle
Win+Space(hold Win, tap Space) — shows overlayLeft Alt+Shift(legacy shortcut, may be enabled)
Per-app input language (Windows 10/11)
Settings → Time & Language → Typing → Advanced keyboard settings → Override for default input method or Let me use a different input method for each app window
macOS input source settings
Check current input source
- Menu bar → flag/icon (top right) → verify
ABC,U.S.,British, etc. - System Settings →
Keyboard→Input Sources→Edit...→ check list
Add/remove input sources
- Add:
+→ select language → choose layout (e.g.,U.S.,ABC,British) →Add - Remove: Select unwanted →
-
Shortcut to cycle
Ctrl+Space(default) — shows input source switcherCmd+Space(if Spotlight not using it)- Configure: System Settings →
Keyboard→Keyboard Shortcuts...→Input Sources
Per-app input source (macOS)
System Settings → Keyboard → Input Sources → Automatically switch to a document’s input source — when ON, each app remembers its own layout.
Shift and modifier key problems
A stuck modifier changes every character:
- Shift stuck → lowercase becomes UPPERCASE, numbers become symbols (
1→!,2→@) - Ctrl stuck → triggers shortcuts (
C→ Copy,V→ Paste), may suppress character input - Alt/Option stuck → Alt codes (Windows) or special characters (macOS)
- Win/Cmd stuck → opens Start menu / Launchpad, intercepts keys
How to detect
Open Stuck Key Detector → tap each modifier (Left/Right Shift, Ctrl, Alt, Win/Cmd) 5×
- Key stays highlighted after release → physically stuck or electrically shorted
- “Stuck” badge appears → modifier not releasing
Test in Key Event Tester
- Open Key Event Tester
- Press
Aalone → noteevent.key - Hold
Shift+ pressA→event.keyshould beA(uppercase),event.shiftKey = true - Release
Shift, pressA→ if still uppercase → Shift stuck
AltGr and international keyboard layouts
AltGr (Right Alt on ISO/EU keyboards) accesses third-level characters:
AltGr+2→²(superscript) or~(tilde) depending on layoutAltGr+E→€(Euro) on many EU layoutsAltGr+Q→@on UK layout
Common confusion
| Layout | 2 key (unmodified) |
Shift+2 |
AltGr+2 |
|---|---|---|---|
| US (ANSI) | 2 |
@ |
(no AltGr) |
| UK (ISO) | 2 |
" |
@ |
| German (DE) | 2 |
" |
² |
| French (AZERTY) | é |
2 |
~ |
| Spanish (ES) | 2 |
" |
@ |
If you’re on a non-US layout but have US keycaps, AltGr combinations will produce unexpected symbols. Check your active layout in OS settings.
Num Lock and embedded numeric keypad
On laptops and compact keyboards (60%, 65%, 75%, TKL), the Num Lock key toggles an embedded numeric keypad on the right side of the alphanumeric block.
Typical embedded keypad mapping (when Num Lock ON)
| Keycap | Produces |
|---|---|
J |
1 |
K |
2 |
L |
3 |
U |
4 |
I |
5 |
O |
6 |
7 |
7 |
8 |
8 |
9 |
9 |
M |
0 |
, |
. |
Symptoms
- Typing
JKLproduces123 UIOproduces456- Letters on right side type numbers
Fix
- Press
Num Lockonce (oftenFn+NumLkon laptops, or dedicated key) - Indicator light on keyboard should turn off
- On some laptops:
Fn+F11,Fn+Insert, orShift+NumLk
Stuck modifier keys (deep dive)
Physical causes
| Cause | Mechanism | Fix |
|---|---|---|
| Debris under keycap | Stem doesn’t return | Remove keycap, compressed air, isopropyl swab |
| Stabilizer wire unclipped (Shift, Enter, Space) | Binds on one side | Re-clip wire, lube stabilizer |
| Switch contact shorted | Liquid residue, corrosion | Clean contact leaf, replace switch |
| Keyboard controller fault | Ghost modifier state | Reconnect keyboard, test on another computer |
Software causes
| Cause | Mechanism | Fix |
|---|---|---|
| Sticky Keys (Windows) | Press Shift 5× → locks modifiers | Settings → Accessibility → Keyboard → Sticky Keys: OFF |
| Slow Keys / Filter Keys | Ignores brief presses, requires long hold | Settings → Accessibility → Keyboard → OFF |
| macOS Sticky Keys | Accessibility → Keyboard → Sticky Keys: OFF | |
| Third-party macro app (AutoHotkey, Karabiner, Razer Synapse) | Remaps or holds modifiers | Quit app, check for “stuck” hotkeys |
| Remote desktop / VM | Modifier state desyncs | Release all modifiers on host, reconnect |
Diagnostic flowchart
Wrong characters?
│
├─► Open Stuck Key Detector → tap each modifier 5×
│ └─► "Stuck" badge? → Physical: clean/replace | Software: check accessibility/macro apps
│
├─► Open Key Event Tester → press A, then Shift+A
│ └─► Shift+A works but A alone gives uppercase? → Shift stuck
│
├─► Check OS language indicator (taskbar/menu bar)
│ └─► Wrong layout? → Switch to correct layout
│
└─► Test on second computer
└─► Problem follows keyboard? → Hardware
Problem stays on first computer? → Software/OS
Accessibility features that change typing
| Feature | Platform | Effect | How to Disable |
|---|---|---|---|
| Sticky Keys | Win/macOS/Linux | Modifiers lock after single press | Win: Settings → Accessibility → Keyboard → OFF |
| Filter Keys | Windows | Ignores brief/repeated presses | Settings → Accessibility → Keyboard → OFF |
| Slow Keys | macOS | Requires longer hold to register | System Settings → Accessibility → Keyboard → OFF |
| Mouse Keys | Win/macOS | Numpad moves mouse cursor | Win: Settings → Accessibility → Mouse → OFF |
| Toggle Keys | Windows | Beeps on Caps/Num/Scroll Lock | Settings → Accessibility → Keyboard → OFF |
Application-specific shortcuts
Some apps intercept keys before they produce characters:
| App | Common Interceptions |
|---|---|
| Browser | Ctrl+T (new tab), Ctrl+W (close), Ctrl+L (address), F5 (reload), Alt+Left (back) |
| VS Code / IDE | Ctrl+P, Ctrl+Shift+P, `Ctrl+`` (terminal), chord shortcuts |
| Games | WASD movement, Shift sprint, Ctrl crouch — may not type in chat |
| Remote Desktop / VM | Host OS captures Ctrl+Alt+Del, Win, Cmd+Tab |
| Password managers | Ctrl+Shift+L, Ctrl+\ — auto-fill shortcuts |
Test: Open Notepad (Windows) / TextEdit (macOS) / gedit (Linux) — type the problematic key. If it works there but not in your app → app shortcut conflict.
Browser-specific behavior
| Behavior | Cause | Fix |
|---|---|---|
Tab doesn’t register in tester |
Browser uses Tab for focus navigation | Enable Capture Keys in tester |
Space scrolls page |
Browser default | Enable Capture Keys or click input field first |
F5 reloads page |
Browser shortcut | Enable Capture Keys |
Ctrl+W closes tab |
Browser shortcut | Test in incognito/private window |
| Extension blocks keys | Password manager, Vim extension, shortcut blocker | Disable extensions, test in incognito |
Always test in a plain text editor first (Notepad, TextEdit) to isolate browser vs system issues.
Keyboard hardware faults (rare cause of wrong characters)
| Fault | Symptom | Distinguishing Feature |
|---|---|---|
| Stuck modifier | All keys shifted/controlled | Stuck Key Detector flags it |
| Chatter | Double/triple characters | Key Press Test shows intervals < 80 ms |
| Ghosting / blocking | Combos drop keys | Anti-Ghosting Test shows FAIL on combos |
| Wrong firmware map | Specific keys always wrong | event.code correct, event.key wrong on ALL computers |
| PCB trace short | Adjacent keys produce each other’s chars | Row/column pattern, fails on second computer |
| Loose ribbon (laptop) | Entire sections wrong | Flexing chassis changes behavior |
Key insight: Hardware faults usually affect specific keys or patterns. Layout/software issues affect entire classes of keys (all letters, all numbers, all shifted symbols).
How to diagnose wrong characters online
Step 1: Check the physical key code (Key Event Tester)
- Open Key Event Tester → RESET SESSION
- Press the problematic key (e.g.,
Q) - Read:
event.code→ physical position (e.g.,KeyQ) — should match keycapevent.key→ character produced by OS layoutevent.location→ 0=standard, 1=left, 2=right, 3=numpad
- If
event.codematches keycap butevent.keyis wrong → layout/software issue - If
event.codeis wrong (e.g., pressQ, getKeyA) → hardware: keycap swapped, PCB miswired, or firmware map wrong
Step 2: Test alphabet keys systematically
- Open Online Keyboard Tester → enable Capture Keys
- Press
AthroughZin order - Watch each key light up — note any that:
- Don’t light up (dead key → Broken Key Detector)
- Light up wrong character (layout)
- Light up multiple times (chatter → Key Press Test)
Step 3: Test number-row keys
- Press
1through0unmodified → should match keycap for your layout - Press
Shift+1throughShift+0→ should match shifted symbols for your layout - Compare with layout reference table
Step 4: Test punctuation keys
Test: , . / ; ' [ ] \ ` - =
- Unmodified and Shift-modified
- These vary most between layouts (US vs UK vs ISO)
Step 5: Test Shift combinations
- Hold
Left Shift→ pressA→ release both - Hold
Right Shift→ pressA→ release both - Both should produce uppercase
- If only one works → that Shift key stuck or dead
Step 6: Test Ctrl, Alt, Win/Cmd (where supported)
- Open Key Event Tester → watch Modifier State panel
- Tap each modifier individually → should toggle ON then OFF
- Hold
Ctrl+ pressA→event.ctrlKey = true,event.key = a(not affected by Ctrl alone) - Hold
Alt+ pressA→ may produce special char (layout-dependent)
Step 7: Compare with text editor
- Open Notepad (Win) / TextEdit (macOS) / gedit (Linux)
- Type the same sequence:
abcdefghijklmnopqrstuvwxyz 1234567890 ,./;'[]\=-` - Compare what appears vs what the Key Event Tester showed for
event.key - Match → browser/app issue. Mismatch → OS layout/input method issue.
Step 8: Check configured OS input language
- Windows: Taskbar language indicator → click → verify
- macOS: Menu bar flag → click → verify
- Linux:
ibus/fcitx/scimindicator, orsetxkbmap -query
Step 9: Test with another keyboard (isolates hardware)
- Connect a known-good external keyboard
- Repeat Steps 1–3
- Problem persists → OS/software issue
- Problem disappears → original keyboard hardware fault
How to identify a stuck Shift, Ctrl, or Alt key
Using Stuck Key Detector (easiest)
- Open Stuck Key Detector
- Tap each modifier 5×: Left Shift, Right Shift, Left Ctrl, Right Ctrl, Left Alt, Right Alt, Left Win/Cmd, Right Win/Cmd
- Any key showing “Stuck” badge or staying highlighted after release → confirmed stuck
Using Key Event Tester (detailed)
- Open Key Event Tester → watch Modifier State panel
- All should show
OFFinitially - Tap Left Shift →
SHIFTshould toggleONthenOFF - If it stays
ON→ stuck - Tap
A→ ifevent.key = A(uppercase) without holding Shift → Shift stuck
Using Online Keyboard Tester (visual)
- Open Online Keyboard Tester → enable Capture Keys
- Tap Left Shift → virtual Shift key should light up then turn off
- If it stays lit → stuck
- Press
A→ ifAlights up (uppercase) without holding Shift → Shift stuck
Physical verification
- Remove keycap (if mechanical) → press stem directly with finger
- Does it return smoothly? → switch OK, check keycap/stabilizer
- Does it stay down? → switch stuck, clean or replace
- Laptop: cannot easily remove keycap → use compressed air at 75°, test in BIOS
How to switch to the correct layout
Windows 10/11
Settings → Time & Language → Language & Region
→ Preferred languages → [Your Language] → ... → Language options
→ Keyboards → Add a keyboard → [Select: US QWERTY, United Kingdom, etc.]
→ Remove unwanted keyboards
Quick switch: Win+Space (hold Win, tap Space)
macOS
System Settings → Keyboard → Input Sources → Edit...
→ + → [Select language] → [Select layout: U.S., ABC, British, etc.] → Add
→ Select unwanted → -
Quick switch: Ctrl+Space (or Cmd+Space)
Menu bar: Click flag/icon → select
Linux (GNOME/KDE)
Settings → Keyboard → Input Sources → + → [Select] → Add
Quick switch: Super+Space (GNOME), Configurable (KDE)
Command line: setxkbmap us (X11)
localectl set-x11-keymap us (systemd)
ChromeOS
Settings → Languages and inputs → Inputs → Add input methods
Quick switch: Ctrl+Shift+Space
Shelf: Click input method indicator
When keyboard repair is necessary
| Scenario | Repair vs Replace | Typical Cost |
|---|---|---|
| Single stuck modifier (mechanical, hot-swap) | Repair: swap switch ($1–2) | $5–15 DIY |
| Single stuck modifier (soldered) | Repair: desolder/solder | $20–50 shop |
| Multiple stuck modifiers | Replace keyboard / PCB | $50–200 |
| Laptop built-in modifier stuck | Replace top case / keyboard module | $150–$700 |
| Wrong firmware map (custom keyboard) | Reflash firmware (QMK/VIA/ZMK) | Free (DIY) |
| PCB trace short (adjacent keys swapped) | Replace PCB or keyboard | $50–200 |
| Liquid damage on modifiers | Professional ultrasonic clean or replace | $100–$300 clean |
Decision rule: If repair cost > 50% of replacement + your time, replace.
FAQs
My keyboard types A when I press Q. Is it broken?
Almost certainly not. This is the classic AZERTY vs QWERTY layout mismatch. Your physical Q key (event.code = KeyQ) is working perfectly — the OS is just translating it as A because the active layout is French (AZERTY). Change your OS input language to English (US) or your preferred layout.
Why does Shift+2 give " instead of @?
You’re on a UK (ISO) layout. On UK keyboards: 2 = 2, Shift+2 = ", AltGr+2 = @. On US (ANSI): Shift+2 = @. Check your OS language settings — you likely have “English (United Kingdom)” selected instead of “English (United States)”.
My keyboard types numbers when I press letters (J=1, K=2, L=3).
Num Lock is ON on a laptop or compact keyboard with an embedded numpad. Press Num Lock (often Fn+NumLk or Fn+F11 on laptops) to toggle it off. The Num Lock indicator light should turn off.
Everything types in UPPERCASE but Caps Lock is off.
Shift key is stuck (physically or electrically). Open Stuck Key Detector and tap both Shift keys. If one shows “Stuck”, clean the switch or check for debris. Also check Windows Sticky Keys (press Shift 5× to toggle) and Filter Keys in Accessibility settings.
Ctrl+C copies but C alone types c — is Ctrl stuck?
No, that’s normal. Ctrl modifies other keys but doesn’t produce a character alone. If C alone types c correctly, Ctrl is not stuck. If C alone does nothing or triggers a shortcut, check Stuck Key Detector.
The online tester shows the right key code but wrong character in my browser.
The tester shows event.code (physical) and event.key (layout output). If event.key is wrong but correct in Notepad/TextEdit → browser extension or site-specific shortcut intercepting. Test in incognito/private mode with extensions disabled.
My keyboard works on another computer but types wrong on this one.
Software/OS issue on this computer. Check:
- Input language/layout (most likely)
- Sticky Keys / Filter Keys / Slow Keys
- Third-party macro apps (AutoHotkey, Karabiner, Razer Synapse, Logitech G Hub)
- Per-app input source setting (macOS/Windows)
Can a virus/malware change my keyboard layout?
Extremely rare. Some malware can hook keyboard input, but 99.9% of “wrong character” cases are layout settings, stuck modifiers, or Num Lock. Run a malware scan if concerned, but check the basics first.
I’m in a VM/Remote Desktop and keys are wrong.
Host and guest OS may have different layouts. Ensure both are set to your desired layout. Some VM tools (VMware Tools, VirtualBox Guest Additions, SPICE agent) sync keyboard layout — install/update them. For RDP: Local Resources → Keyboard → “On this computer” or “On the remote computer”.
How do I know if it’s a hardware fault vs layout issue?
The definitive test: event.code in Key Event Tester.
event.codematches keycap,event.keywrong → Layout/softwareevent.codewrong (pressQ, getKeyA) → Hardware (keycap swapped, PCB, firmware)- Test on second computer to confirm.
Why does my keyboard work in BIOS but not in Windows?
BIOS uses a hardcoded US layout map. If it works in BIOS but not Windows → Windows driver/layout/settings issue, not hardware. Reinstall keyboard driver (Device Manager → Uninstall → Reboot), check layout, check Filter Keys.
Quick Diagnostic Checklist
☐ PHASE 1: Quick layout check
☐ Check OS language indicator (taskbar/menu bar) → correct?
☐ Win+Space / Ctrl+Space → cycle to correct layout
☐ Num Lock OFF? (laptop/compact keyboards)
☐ PHASE 2: Test physical key codes
☐ Open Key Event Tester → press problematic key
☐ event.code matches keycap? → YES = layout/software, NO = hardware
☐ event.key matches expected for your layout?
☐ PHASE 3: Test modifiers
☐ Open Stuck Key Detector → tap each Shift/Ctrl/Alt/Win 5×
☐ Any "Stuck" badges?
☐ Key Event Tester → Modifier State panel → all OFF at rest?
☐ PHASE 4: Systematic key test
☐ Online Keyboard Tester → A-Z, 0-9, punctuation
☐ Note: dead keys, wrong chars, chatter
☐ Broken Key Detector → consistency test on suspect keys
☐ PHASE 5: Cross-application check
☐ Type in Notepad/TextEdit → same wrong chars?
☐ If NO → browser/app shortcut conflict
☐ If YES → OS/layout/hardware
☐ PHASE 6: Hardware isolation
☐ Test on second computer (or external keyboard on laptop)
☐ Problem follows keyboard? → Hardware
☐ Problem stays on computer? → Software/OS
☐ DECISION
☐ Layout mismatch → Change OS input source
☐ Stuck modifier → Clean switch / disable accessibility / quit macro app
☐ Num Lock → Toggle off
☐ Hardware fault → Repair or replace per cost table
Related Tools & Guides
- Online Keyboard Tester — Full keyboard visualization, layout testing, chatter detection
- Key Event Tester — Raw
event.code,event.key,event.location, modifier state - Stuck Key Detector — Stuck modifier detection, continuous press monitoring
- Broken Key Detector — Dead/disconnected key isolation, consistency test
- Key Press Test — Tap cadence, chatter detection, frequency analysis
- Anti-Ghosting Test — Simultaneous key combos, rollover verification
- Hardware vs Software Dead Key Diagnosis — Systematic isolation
- Keyboard Key Chattering Guide — Double-firing switch diagnosis
- Laptop Keyboard Not Working After Windows Update — Driver/layout issues
- Keyboard Not Detected? Fix Guide — Connection/driver troubleshooting
Start diagnosing now:
- Key Event Tester → (check physical vs logical key)
- Stuck Key Detector → (check modifiers)
- Online Keyboard Tester → (full board sweep)
- Broken Key Detector → (dead key isolation)
Test every key directly in your browser
Detect stuck keys, key chatter, input latency, and full rollover with our instant, zero-download diagnostic tool.
Start Keyboard Test →


