Vim Tips Wiki

Changes: Swap caps-lock and control keys using MS Windows Registry


Back to page

(Creating an undo registry file)
(Replace merged tip with redirect)
(One intermediate revision by one user not shown)
Line 1: Line 1:
#REDIRECT [[Map caps lock to escape in Windows]]
|created=October 29, 2002
|author=Jacques Petit
On Windows systems, you can edit the registry to change the code produced when a key is pressed. This tip shows how to change the keyboard layout so that the CapsLock key acts as a Ctrl key.
==Replacing CapsLock with Ctrl==
Place the following text into a text file with the extension *.reg and update your registry by double-clicking the file:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00
You will probably need to reboot your machine for this system change to take effect.
====Undoing the change====
The verified way to reverse this setting is to delete the new scan codes key that was added.
(tested this on one of my machines)
====Swapping keys rather than replacing CapsLock====
The registry entry above sets CapsLock to Ctrl. The following registry entry swaps the CapsLock and Ctrl keys on your keyboard. Useful if you sometimes use CapsLock.
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,1d,00,3a,00,3a,00,1d,00,00,00,00,00
====Setting the key layout for the current user====
If the machine has multiple users who might not like the new layout, instead of using [HKEY_LOCAL_MACHINE\....] you can specify [HKEY_CURRENT_USER\Keyboard Layout]. This will make the changes for one user account only. Additionally, simply logging off and back on will apply the changes (no need to reboot).
Some explanation is [ here].
A more detailed explanation and reference can also be found [ here].

Latest revision as of 11:51, July 19, 2009

  1. REDIRECT Map caps lock to escape in Windows

Around Wikia's network

Random Wiki