For remapping any physical key on the keyboard is a registry entry.
It's in [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
You create a key with the name Scancode Map
. It can redirect any key to another key or disable it.
That key is a hex-value with the following meaning:
00,00,00,00 Header: Version. Set to all zeroes.
00,00,00,00 Header: Flags. Set to all zeroes.
05,00,00,00 5 entries in the map (including null entry).
38,00,1d,00 Left CTRL -> Left ALT (can also be another key).
1d,00,38,00 Left ALT -> Left CTRL.
38,e0,1d,e0 Right CTRL -> Right ALT.
1d,e0,38,e0 Right ALT -> Right CTRL.
00,00,00,00 Null entry.
To swap the CTRL and ALT keys you need four entries (plus null).
The Left Left-CTRL (1d 00), the Left Left-ALT (38 00), the Right-CTRL (1d e0), and the Right-ALT (38 e0).
So you can create a .reg file like this: Disable_CTRL-key.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,05,00,00,00,38,00,1d,00,1d,00,38,00,38,e0,1d,e0,1d,e0,38,e0,00,00,00,00
Execute (double click) the .reg file and log out and back in (or restart your computer). Now your CTRL and ALT keys should have been swapped.
Other useful keys to know:
1d 00 Left Ctrl
1d e0 Right Ctrl
38 00 Left Alt
38 e0 Right Alt
5b e0 Left Windows Key
5c e0 Right Windows Key
5d e0 Windows Menu Key
(Based on this answer by Rik)
If you are not comfortable with changing the registry or you want other keys too you can use the program SharpKeys to edit them more easily. It also has a convenient list of all keys so you can just add them in a window.
While SharpKeys (perhaps - I cannot actually verify that it did work) used to be an alternative option, SharpKeys' current Readme states that SharpKeys cannot be used for this purpose, although it can be used for other key remappings. (h/t gabe)
Alternatively, I found the Windows Server 2003 Resource Kit Tools which contains a small executable called remapkey.exe
, only 340KB in size. It is a graphical program which allows you to remap the keys of your keyboard. A reboot is required, as with any manual change. In Windows Vista+ it will require Admin privileges.
While looking for some screenshots, I came across another answer on this site which recommends it:
The best tool for the job is Microsoft's own remapkey
, available as part of the Windows Resource Kit. (That link is for Windows 2003; I've used it successfully over the years on many versions of Windows, including Windows 7; have not tested Windows 8).
remapkey
will write the mapping directly into the registry, I
believe, and does not require a running process. You simply drag from
actual key to desired key, and save.
Further Reading:
As you might imagine, this is a rather popular request. While there may be some minor quirks involved with the process, other community members have done it using AutoHotkey as seen both here and here.
– Run5k – 2017-03-19T22:51:41.643I would say not to do that, for several reasons. First, this prevents you from ever learning to use the keyboard regularly - if you ever need to use someone else's computer, this will make it hard for you. Also, it will make it hard for other people to use your computer. Finally, in my experience (a Windows user who sometimes has to use a Mac for work), it takes only a few days to get used it the change the first time, and it takes only a minute or two to change between them as I switch between computers over the course of a day. – Moshe Katz – 2017-03-20T00:24:35.740
https://superuser.com/a/1132401/494585 – Ploni – 2017-03-20T03:16:05.823
3Regularity is not my concern. No one will be using my machine but myself either. – zjdrummond – 2017-03-20T23:52:53.477
I would suggest this solution https://superuser.com/questions/36920/how-can-i-remap-a-keyboard-key rather than an AutoHotkey solution. Remapping keys in Windows can be done with Registry modification and the use of the SharpKeys utility (which does the registry modification and does not need to remain running full-time to intercept keys).
– music2myear – 2017-11-01T17:12:01.550The best solution I have found is to buy a JIS japanese keyboard(laptop or external) and then assign the thumb modifiers to CTRL on the keyboard using SharpKeys. Then effectively the Ctrl/Cmd keys are effectively in the same place. – William – 2018-11-28T17:32:04.137