Hurrah for muscle memory

2007 July 13
by Sam Freney

Command KeyThis is a nice little hack for those of you who use macs and need to dive into X11 from time to time, for example if you use the Gimp, Inkscape, or Openoffice.

One of the annoyances in X11 is that shortcuts that apply in the rest of the OS X world don’t apply in X11 (e.g. the ‘copy’ shortcut, ?-C, doesn’t apply for something like the Gimp. You need to do ctrl-C instead, which throws out all your hard-earned muscle memory).

So the trick is this. The Cmd key (?) is designated the ‘meta’ key in X11. I don’t use the meta key for any of my apps. If you don’t know what it is, then you probably don’t either.

We then just map the function of the control key over to the command key, so they do the same job. This means all the normal ctrl- shortcuts work as normal, and all the native application muscle memory works nicely too.

What you need to do is create a file called .Xmodmap in your home directory (or just add to it if it already exists). Enter the following lines:

clear Mod2clear
controlkeycode 63 = Control_L
keycode 67 = Control_L
add control = Control_L

This code maps the Control key to the command key, so they effectively do the same thing.

Now go into your X11 preferences. You should uncheck the ‘Use the system keyboard layout’ option.

Next time you start up X11, it should be re-mapped. Voila.

Note: The code from this came from //extrabright. Many thanks.

No comments yet

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS