Keyboard Typing Wrong Letters: Check Your Layout
When a keyboard types the wrong letters or symbols, check the active input layout before treating it as a broken switch. Open the keyboard test and compare the last event's code and key, then type the same key in a plain text field.
Position and character are different
code describes a standardized key position. key describes the value interpreted by the system, including layout and modifier effects. A QWERTY-position code such as KeyQ does not guarantee that the character is Q on an AZERTY or Dvorak layout.
If the expected position registers consistently but the character differs from the legend, investigate the input layout, modifiers and mappings first. A remapper or firmware profile can also change what reaches the browser, so the code is not a direct electrical measurement.
Match the symptom
| Symptom | Check |
|---|---|
| At sign and quotation mark appear swapped | US versus UK input layout |
| Y and Z appear swapped | QWERTY versus QWERTZ layout |
| Many letters appear shifted to other positions | Selected language/layout and remapping profile |
| Letters on a laptop produce numbers | Embedded numpad or Fn/Num Lock mode |
| Letters are always uppercase | Caps Lock, held Shift and Sticky Keys |
| An accent key waits for another letter | Dead-key input method or composition behavior |
A “dead key” in language input means an accent/composition key; it is different from a nonresponsive physical key.
Check the selected input method
On Windows, use the taskbar input-language menu or Windows + Space to inspect installed layouts. The display language and keyboard layout can be configured separately. Select the layout matching the physical keyboard and remove unwanted alternatives only if you do not need them.
On macOS and ChromeOS, inspect the active input source in system settings. If input is correct in a local editor but wrong in a remote desktop, compare the local and remote layouts. If only one game is affected, check that game's bindings rather than changing the entire operating-system layout.
Check modifiers and profiles
Release both Shift keys, Control, Alt/Option and Command/Windows. Use the stuck key test if a modifier continues to appear held. Review keyboard layers and macros; restore a known profile only after saving custom mappings you need.
If an unrelated key appears even with the correct layout and no remapping, compare another connection or computer. For an isolated key that produces extra copies of the correct letter, use the double-letter guide.
Sources
- Microsoft: language and keyboard layout settings.
- MDN: KeyboardEvent.code explains why position and printed character differ.
- How Keyboardtest interprets events.