I'm a long time Mac user, but I just built a PC. Not liking the ctrl and alt keys locations. I'm always expecting the ctrl key to be where the command key is on my Macbook. Can I moved swap these somehow? I'm running Windows 10, and I'm up to date.
-
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](https://www.howtogeek.com/290501/how-to-create-custom-keyboard-shortcuts-with-autohotkey/) as seen both [here](https://superuser.com/questions/631210/making-ctrlalt-combinations-available-after-switching-the-keys-with-autohotkey?rq=1) and [here](https://superuser.com/questions/202322/switch-ctrl-and-alt-with-autohotkey-without-messing-up-the-alt-tab-switcher?rq=1). – Run5k Mar 19 '17 at 22:51
-
1I 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 Mar 20 '17 at 00:24
-
https://superuser.com/a/1132401/494585 – Mar 20 '17 at 03:16
-
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 Nov 01 '17 at 17:12
-
The 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 Nov 28 '18 at 17:32
2 Answers
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 (archived download) 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).
remapkeywill 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:
-
Another plus for remapkey on Windows 10. It felt a bit sketchy installing the Windows 2003 Kit on WIndows 10, but all worked. It sure beats always running autohotkey in the background, thanks! – PKKid Nov 07 '18 at 03:00
-
1remapkey is still working on Windows 10 (10.0.18363)! I used it to swap the Right Shift and "ç" key for reasons that will exceed the maximum number of characters for this comment I couldn't find it on Microsoft's site, though. I used this link: https://news.ycombinator.com/item?id=20485212 (yeah, sketchier and sketchier ) – yannick1976 Mar 24 '21 at 22:52
The key remapping utility Sharpkeys (Download) should let you rebind your keys however you'd like. (Source)
Steps:
- Open Sharpkeys and click Add
Add the following two entries as key mappings
From: To: Special: Left Alt (00_38) Special: Left Ctrl (00_1D) Special: Left Ctrl (00_1D) Special: Left Alt (00_38)Confirm your remappings, then click Write to Registry
- 13,555
- 39
- 101
- 154
-
2This will not let you swap keys so unfortunately this won't work. https://github.com/randyrants/sharpkeys – William Sep 18 '18 at 22:38
-
See my comment https://superuser.com/questions/1190329/can-i-switch-the-alt-and-ctrl-keys-on-my-keyboard#comment2078769_1202601 that agrees with @William – gabe Nov 28 '18 at 17:16
-
5SharpKeys may now be used to swap keys with each other. Latest README may be found here: https://github.com/randyrants/sharpkeys It states on the page that SharpKeys will "allow you to swap two keys with each other - e.g. you can swap Left Windows with Left Control and vice versa" – arimbun Apr 18 '19 at 12:44

