guidox / Hardware

Fix a Keyboard That Types the Wrong Characters

TL;DR

Check the layout for the logged-in user with **Get-WinUserLanguageList**, remove the unused one, and set the **Override for default input method**. Test in Notepad, not in the app that misbehaves.

Before you start

Requirements

  • Windows 11
  • The affected keyboard
  • 10 minutes
Step by step

Instructions

01

See which layouts are installed

Each installed layout adds its own input method. Two layouts mean the taskbar shows a switcher, and a stray **Ctrl+Shift** or **Win+Space** cycles between them.

Get-WinUserLanguageList | Select-Object LanguageTag,Autonym
Get-WinUserLanguageList | ForEach-Object { $_.InputMethodTips }
Get-WinDefaultInputMethodOverride
02

Remove the layout you do not need

Keeping one layout removes the way to switch by accident. Set-WinUserLanguageList with **-Force** replaces the list in one step.

$list = Get-WinUserLanguageList
$list = $list | Where-Object LanguageTag -eq 'en-US'
Set-WinUserLanguageList $list -Force
Get-WinUserLanguageList | ForEach-Object { $_.InputMethodTips }
03

Set the default input method

**Set-WinDefaultInputMethodOverride** decides which layout a new window gets. Without it, Windows reuses the last layout used per app window.

Set-WinDefaultInputMethodOverride -InputTip '0409:00000409'
Get-WinDefaultInputMethodOverride
Get-ItemProperty 'HKCU:\Keyboard Layout\Preload' | Select-Object -Property * -ExcludeProperty PS*
04

Rule out a stuck modifier key

AltGr, Alt and Ctrl produce the same wrong-symbol symptoms as a layout mismatch. Sticky Keys and a physically stuck key both look identical from the app side.

Get-ItemProperty 'HKCU:\Control Panel\Accessibility\StickyKeys' | Select-Object Flags
Get-ItemProperty 'HKCU:\Control Panel\Accessibility\ToggleKeys' | Select-Object Flags
# open Notepad and type: a b y z 1 2 3 @ # \ |
notepad.exe
05

Test with an on-screen keyboard

If the on-screen keyboard produces the right character while the physical one does not, the problem is the hardware or a remap. If both are wrong, it is the software layout.

Start-Process osk.exe
# press the same keys on screen and compare
Get-PnpDevice -Class Keyboard | Select-Object FriendlyName,Status,InstanceId
06

Check for a key remap

A Scancode Map value or a PowerToys keyboard remap silently rewrites keys. Both survive a layout change, which is why the wrong characters return after the fix.

Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Keyboard Layout' -Name Scancode -ErrorAction SilentlyContinue
Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Keyboard Layout' | Select-Object Scancode
Get-Process powertoys -ErrorAction SilentlyContinue | Select-Object Name,Id
Troubleshooting

Common issues

The layout switches back on its own

The per-app layout is remembered. Set the override for the default input method and remove the second layout entirely.

Only one app types wrong characters

The app has its own keyboard setting or a shortcut conflict. Test the same text in Notepad first to isolate it.

The number row types symbols

NumLock is off on a laptop with a numeric keypad layer, or the layout is a different language. Check the layout list first.

The on-screen keyboard is correct but the physical one is not

A hardware fault or a remap. Try another keyboard before editing any registry value.

FAQ

Frequently asked

Does removing a layout delete a language?

It removes the input method. The display language and the language pack stay installed if you do not remove them separately.

Why do y and z swap?

That is the German layout on a US keyboard, or the reverse. The physical printing on the keys does not control what Windows sends.

Can I keep two layouts without the switcher?

No. Two layouts always create the switcher; a single layout removes it and the accidental switching with it.

How to undo this

Add the removed layout back with Set-WinUserLanguageList after appending it, and clear the override with Set-WinDefaultInputMethodOverride -InputTip ''.

Changelog · 1 entry
  1. 2026-11-01
    First version
Interactive version: checklist, feedback, related guides →

Free · no account needed · tracks your progress