Windows keyboard guide
Swapped Keys Not Working in Windows? Causes and Fixes
A key swap that fails or comes back after a restart almost always has one of six causes. Match your symptom below and the fix is one setting away.
Swapped keys not working in Windows: quick answer
When swapped keys stop working in Windows, check three things in order: whether the swap tool is still running, whether the program you are typing in runs as administrator, and whether both mappings exist. Those three explain most failures. A registry swap that does nothing needs a restart or sign-out first.
Match your symptom to the cause
Most failed swaps fit one row of the table below. Find the symptom that matches what you see, then apply the fix in the same row before you change anything else.
| Symptom | Likely cause | Fix |
|---|---|---|
| Swap stops after a restart | The tool does not start at sign-in | Turn on Run at startup in PowerToys General, or add the script to shell:startup |
| Works in Notepad, not in one app | The app runs as administrator | Run PowerToys as administrator, or use the registry method |
| Both keys type the same letter | Only one mapping exists | Add the reverse mapping |
| Nothing changed after a registry edit | Windows has not reloaded the value | Restart Windows, or sign out and in |
| Letters Y and Z or A and Q swapped | Input language changed | Press Win+Space to return to your layout |
| Fn or media key will not remap | Firmware handles the key | Swap the keys around it instead |
| Swap fails only in a game | The game reads the keyboard directly | Try the registry method, or swap inside the game’s own controls |
Swapped keys fail only in administrator windows
A swap that works in Notepad but not in Task Manager, Registry Editor or an installer is an elevation problem. Windows keeps a normal program from sending input into an administrator window, and PowerToys is subject to that rule.
PowerToys documents the fix: run PowerToys itself as administrator, which General settings offers as an option. AutoHotkey has an equivalent through UI access or an elevated script. The registry Scancode Map needs neither, because Windows applies it before any program sees the key.
Open Notepad as administrator by right-clicking it and choosing Run as administrator, then press each swapped key. If it passes there, the elevation fix worked.
The swap disappears after a restart
A swap that vanishes after a restart means the tool is not running at sign-in. Keyboard Manager only remaps while PowerToys is running in the background, and an AutoHotkey script ends with its process.
- Open PowerToys Settings, then General, and turn on Run at startup.
- Restart Windows and check the PowerToys icon in the tray.
- For AutoHotkey, press Win+R, enter
shell:startupand put a shortcut to your .ahk file in the folder. - For the registry method, confirm the Scancode Map value still exists in the Keyboard Layout key. If it is gone, another tool or policy removed it.
If the value keeps disappearing on a work PC, a management policy may be resetting it. That is an IT conversation, not a bug in your swap.
Keys swapped by accident, not by you
When Y and Z, or A and Q, trade places without any tool involved, an input-language switch is the usual reason. Windows cycles layouts with Win+Space, and some setups also use Alt+Shift or Ctrl+Shift.
Open Settings, choose Time and language, then Language and region, and look at the keyboard layouts listed for your language. Remove any you do not use. A stray layout is the quiet reason a swap seems to appear from nowhere, and it also changes where symbols such as the at sign and the quote marks sit.
A virus swapped my keys.
A layout switch is far more likely. Check the language indicator in the taskbar before you suspect anything else.
Reinstalling the keyboard driver fixes a swap.
Layouts and mappings live above the driver, so a driver reinstall usually changes nothing.
Take the swap off when nothing else works
To remove a swap, delete the mapping where you created it: both rows in PowerToys, the Scancode Map value in the registry, or the script from the Startup folder. Then restart.
| Method | Reset |
|---|---|
| PowerToys | Remap a key, delete both rows, select OK |
| Scancode Map | Delete the value or import a file containing "Scancode Map"=-, then restart |
| AutoHotkey | Exit from the tray icon and remove the Startup shortcut |
If the registry swap locked you out of typing a password, start Windows in Safe Mode, delete the value and restart. Keep a second keyboard or the on-screen keyboard within reach until the swap is proven.
Run the full checklist
Frequently asked questions
Why did my swapped keys stop working in Windows?
The usual cause is the tool, not the mapping. PowerToys stops remapping when it exits, an AutoHotkey script stops when its process ends, and a registry change needs a restart. Check the tool is running before you edit any mapping.
Why does the swap work in Notepad but not in another program?
That program probably runs as administrator. PowerToys documents that Keyboard Manager does not reach an elevated window unless PowerToys also runs as administrator. A registry Scancode Map avoids the problem because it applies below the program layer.
Why do both swapped keys now type the same letter?
Only one of the two mappings exists. A to B without B to A leaves both keys sending B. Add the missing reverse row in PowerToys, or the second line in an AutoHotkey script, and test again.
Why did my keys swap by themselves?
On a Windows PC, an accidental input-language change is the likeliest reason. Switching between layouts such as QWERTY and QWERTZ moves letters like Y and Z. Press Win+Space, or the Alt+Shift shortcut, to cycle back to your layout.
How do I put my keys back after a registry swap?
Delete the Scancode Map value from the Keyboard Layout key, or import the undo file from the main guide, then restart Windows. If you cannot type your password, start Safe Mode, delete the value there and restart again.
Can a laptop Fn key be swapped back?
A mapping of the Fn key itself usually cannot be changed, because the keyboard firmware handles it before Windows sees a keypress. If a function-row key behaves oddly, look at the Fn Lock setting in your laptop’s BIOS or vendor app.
Where to go next
The full process, from install to undo, is in the main guide: step-by-step swap instructions. To compare the three free methods before you pick again, read PowerToys vs Scancode Map vs AutoHotkey.