GB Colemak

My laptop died last week (conveniently during a trip to UCL when I really wanted it to work) and so I took the opportunity to upgrade it to the beta version of Ubuntu Hardy. First impressions are all good --- everything becomes progressively more Mac-like and shiny --- although I have some issues with the usability of the Compiz window effects, pretty though they undoubtedly are. The upgrade also made me think again about my Colemak keyboard layout, which has been necessary on my laptop since I prised all the keys off 6 months ago and put them back down in a different order.

On the whole I have no complaint with Colemak --- I don't get any RSI symptoms on my laptop keyboard anyway, so it's not really solving any problem, but the combination of curiosity, perversity, defying misplaced historical convention, and generally checking that my mind is still able to learn new things still keeps me at it. Actually a simplification: all but four of the keys are now in the correct Colemak positions. The remaining 4 are troublesome because the two index finger "anchor" keys on the home row attach to the laptop body differently from the rest of the keys. So "t" & "f", and "j" & "n" are reversed, which still confuses me. So much for my touch-typing skills. Anyway, as Shai Coleman himself has said, even if you don't want to learn a new keyboard layout, backspacing is a much better use for the Caps-Lock key than actually locking caps, so it's worth adding that feature to your keymap, whatever layout you're using.

In the back of my mind, though, has always been the concern that I had to do some pretty arcane stuff with the X server xkb configuration to add this non-standard keymap. Now life is a bit easier for the Colemak user: Ubuntu Hardy includes it out of the box, thus proving that someone was more successful than me in working out how to get it in there. However, it's the usual US Colemak keymap, with at-signs, quotes and tildes in places that seem weird to we Limeys. And no sterling sign!

So, for all those Brits using Colemak keyboard layouts on Linux (hmm, that must be a lot of people, huh?), here's an xkb patch to make everything as it should be:

To /etc/X11/xkb/symbols/gb, add this section:

partial alphanumeric_keys
xkb_symbols "colemak" {
    include "us(colemak)"
    name[Group1]="United Kingdom - Colemak";
    key <AE02> { [         2,   quotedbl,  twosuperior,    oneeighth ] };
    key <AE03> { [         3, sterling, threesuperior,    sterling ] };
    key <AE04> { [         4,     dollar,     EuroSign,   onequarter ] };
    key <AC11> { [apostrophe,         at, dead_circumflex, dead_caron] };
    key <TLDE> { [     grave, notsign,          bar,          bar ] };
    key <BKSL> { [numbersign, asciitilde,   dead_grave,   dead_breve ] };
    key <LSGT> { [ backslash, bar,          bar,    brokenbar ] };
    include "level3(ralt_switch_multikey)"      };

That was the bit that actually did the work of remapping the offending keys. Now make sure that it's declared properly to and Gnome, by adding this to the "GBr" section in /etc/X11/xkb/base.xml


It should be pretty obvious where to put it: search for "GBr" and insert this before the corresponding <variant> entry for the Dvorak map. Now restart X (or get it to re-read the xkb config) and you should be able to select Colemak as a GB keyboard variant. Woo.

This has now been submitted as a patch to the FreeDesktop XKeyboardConfig project, and so will hopefully make it into some mainstream distributions by the next set of releases.


Comments powered by Disqus