OSX native Inkscape shortcuts

Are you an avid Inkscape user, on a Mac, love all except the quirky XQuartz (formerly Apple X11) keyboard shortcuts? Here's what you gotta do to make 'em native. (hat tip to commenter at maururu.net)

Make some edits the hidden .xmodmap file in your home directory. Check first if there even is a .xmodmap file there. If not, you can download a ready-made below and skip the editing.

Editing: a (reasonably) easy way to do this is to enter
nano .xmodmap in the terminal.

This brings up the nano editing program. Enter the following at the beginning of the file:
clear mod2
clear Control
keycode 63 = Control_L
keycode 67 = Control_L
keycode 71 = Control_L
keycode 60 = Alt_L
keycode 66 = Alt_L
add mod1 = Alt_L
add Control = Control_L

Then press

  1. Ctrl-O to save
  2. enter to confirm
  3. Ctrl-X to exit
  4. Done! Seems you also need to restart your mac for changes to have effect

Ready-made .xmodmap

If you do not have a .xmodmap file already, or you've decided to throw it away anyway, download the file below. Then put it in your home directory and enter
mv ~/xmodmap ~/.xmodmap
to rename and make it invisible (you are not allowed to do this using the Finder)

Almost done

X11, which Inkscape runs under, has a convenient feature where keyboard equivalents are replaced to make use on a mac slightly easier. Unfortunately, it conflicts with the hack described above, particularly ⌘C will trigger the system copy instead of Inkscape's. Fortunately, it's easy to disable and appears to have no side effects concerning Inkscape anyway.

  1. Open the X11 preferences
  2. Select input
  3. Deselect the third item - enable key equivalents under X11

Leopard listing

The snippet below used to solve these problems for Apple's X11 back in OSX 10.6 (and 10.7?) Keeping it here for reference, does not work with XQuartz in 10.8, see above instead.

keycode 63 = Control_L
keycode 71 = Control_L
keycode 60 = Alt_L
keycode 66 = Alt_L
clear mod1
clear Control
add mod1 = Alt_L
add Control = Control_L

AttachmentSize
xmodmap (rename to use)173 bytes