benf.org :  other :  scanmapset

ScanMapSet

Windows 2k and xp have a (not particularly well known) feature described here, which allows you to tell the windows keyboard driver to remap certain keys; this is pretty handy, as it means you don't have to do any digging in the widows internals, you just set a registry key, and bob's your uncle...

The above link gives all the details, but basically, there's a set of pairs (map key 'a' to key 'b') in HKEY_LOCAL_MACHINE\ SYSTEM\CurrentControlSet\Control\Keyboard Layout\Scancode Map in the registry.

I knocked this up a while ago, but I spotted someone in work levering their caps lock key out to stop them hitting it recently, so I'm posting this as a possibly more aesthetically pleasing (though probably not as satisfying) solution! :)

screenshot

And, lo, one reboot later, pressing caps lock simply causes 'shift' to be pressed!

Unfortunately, as the doze keyboard driver only remaps the scan key set when it starts, you need to reboot windows for any settings to take effect. It's not my fault, honest!

You don't have to remap key to key, you can just disable a key by mapping it to 'nothing', eg scanmapset -s capslock=nothing


Warning - if you remap a key in your password, you will find it REALLY awkward to log in......

you can (luckily) get around this by entering the ascii codes for keys directly (a handy trick) - e.g. to enter 'a', hold down 'alt', and enter 97 on the numeric keypad. A full list of ascii codes (what, you don't know them?!) is at http://www.asciitable.com.
Last updated 12/2006
Vi is just great