blog.rupamsunyata.org

Decklin’s excuse for some blogging software. Est. 2006.

Dealing with it

I had this crazy idea a few months ago which Joey's post about muscle memory reminded me of.

For those not in the US, our keyboards have ` and ~ on the key to the left of 1. I prefer this key to be Esc. Long ago I simply swapped the two keys, but the original "Esc" key is always in some weird and inconsistent place and reaching for ~ became as annoying as reaching for Esc. (I suppose I might not care if I didn't use a unix shell or regular expressions or bit masks or...)

So, noting that I mostly only wanted that key for ~, and not `, I came up with the following (in xmodmap form):

keycode 49 = Escape asciitilde grave Escape

This means: if you just hit the key, it does the Right Thing (Esc, as if I were on a real unixy keyboard). If you hold Shift and press the key, it also does the Right Thing (~, as if I were on a PC). But what to do about `, or Shift-Esc, which are no longer possible? We make them the alternate graphs (just old down AltGr. I think the xkb option to put this on right Alt is "grp:switch"). I honestly use those two infrequently enough that I don't care about having to remember the extra bucky.

(I tend to type $(cmd) in the shell, and not `cmd`, because I use the former in scripts and I always found the latter harder to read. I suppose I would care more if I used Lisp or Haskell or...)

What I like most about this solution is that it lets me use the same muscle memory on all my hardware. Never mind weird Esc positions; laptop vendors still can't agree on the correct order of Fn and Control. But you don't have to care if you put Control on Caps Lock. Same idea. It does feel a bit like cheating, but it has made my wrists far more comfortable.

Oh, and to wean myself off the key way out in the corner:

keycode 9 = NoSymbol

Now the question, of course (getting back to Joey), is what would happen if my "new" Escape key broke. I guess I'd have to keep the laptop at home and plug in my Happy Hacking Keyboard :-)

Generated by Mnemosyne 0.12.