sponsor Vim development Vim logo Vim Book Ad

basic Tip #136: Remapping Alt, Ctrl and Caps in Win2k

 tip karma   Rating 88/31, Viewed by 3827 

Read and edit this tip on the Vim tip wiki. The wiki may have a more recent version of this tip.

created:   October 12, 2001 19:04      complexity:   basic
author:   Jean-Paul Darcis      as of Vim:   5.7

Since I installed Win2K on my laptop, I had been unable to locate a utilitie that would simply enable me to remap my Crtl Alt and Caps the way I think they should be and the way they were until MS kill all competition in computing, that is Crtl on the left of the letter A, Alt to the left bottom of the letter Z and Caps approximately until the C.

After some research, I came across a tip posted here by juano@mindspring.com. I tried to make sense of it and then downloaded the MS scan keys map at the URL he mentionned.

Extrapolating his tip, I wrote this ASCI file that I named keys2000.reg :

[HKey_Local_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,04,00,00,00,3A,00,38,00,38,00,1D,00,1D,00,3A,00,00,00,00

Once you have saved this file, left click on it from Explorer and answer yes to the prompt "do you want to enter this into the registry".

Reboot and you are done.

A few explanations :04 stands for 3 remappings (Caps lock to Control, Control to Alt and Alt to Caps Lock) plus the closing one which is always required (1 remapping would require 02, 2 would require 03, and so on). 3A,00,38 remaps Caps to Left Alt, 38,00,1D remaps Left Alt to Left Ctrl and 1D,00,3A remaps Left Ctrl to Caps Lock since 3A=Caps, 1D=Left Ctrl and 38=Left Alt.

Based on Juano tip and on this one, I believe a lot of remapping can be done as long as you keep the separators 00 and remember to add one to the number of remappings. What I do not know is how far you can extend this instruction without getting into trouble with the registry. At worst, if you keyboard does not behave as expected, go into the registry and delete this instruction (be careful here since it is easy to confuse this instruction with the Keyboard LayoutS (S for emphasis) which must not be deleted.

Again, thanks to Juano@mindspring.com who got me going and suggested I post my tip. Took me some time to retrieve the VIM Url but fortunately, I had printed his tip.


 rate this tip  Life Changing Helpful Unfulfilling 

<< Vim buffer FAQ | automatically wrap left and right >>

Additional Notes

leifw @(at)@ bigfoot .(dot). com, December 13, 2001 6:40
I had to make the "Regedit4" at the beginning of the registry entry all caps for this to work on NT4.
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
SourceForge.net Logo