When using Windows XP at work, I have customized the keyboard layout to almost match my setup on Gentoo — important when you code lines and lines of Java…

In addition to my modified Colemak keyboard layout created by the Microsoft Keyboard Layout Creater, I use scancodes to remap special keys, which is not possible in MKLC.

My current setup is this:

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,08,00,00,00,01,00,3a,00,3a,00,01,00,19,00,46,00,0e,00,19,00,2a,00,56,00,38,00,38,e0,38,e0,2a,00,00,00,00,00

Note: Be careful when pasting stuff like this into your registry — you have been warned :-)

The scancode mapping does the following:

  • Swaps Escape and Caps Lock.
  • Makes QWERTY P an extra Backspace key.
    Remember, Colemak has the semicolon on QWERTY P’s position. This makes it possible to delete
  • Makes P available on Scroll Lock.
    A pragmatic backup key for P when using other layouts than Colemak. For instance, some virtual machines read raw input from the keyboard, but the scancode map still applies.
  • Moves Left Shift to Less Than (at the right of Left Shift on pc-105 keyboards).
    This eases the strain on the left little finger.
  • Copies Left Alt to Alt-Gr.
    This way, you can use both hands for the Alt modifier, which greatly reduces the strain on the hands. Generally, use the one hand for the key and the other hand for the modifier.
  • Moves Alt-Gr to the original position of Left Shift.
    Takes a little to get used to, but very handy when defining custom keybindings.

The format of the scancode map is pretty simple:

00,00,00,00, <- preamble
00,00,00,00,
08,00,00,00, <- number of remaining 4-tuples (end-sequence inclusive)
01,00,3a,00, <- swap Escape and Caps Lock
3a,00,01,00,
...
00,00,00,00  <- end-sequence

You can find more information on the scancode map format here, and a scan code reference here. Have fun…

  • Facebook
  • Twitter
  • Digg
  • Reddit
  • del.icio.us
  • StumbleUpon

Related posts:

  1. English keyboard layout with Danish characters
  2. “Danish” Vim-friendy Colemak Layout
  3. Mice are for cats…