MacOS X Xquarz and xmodmap

I finally bit a bullet and set up the keymap for Mac. Here is my current ~/.Xmodmap file content.

! left-alt 66
! right-alt 69
! left-command 63
! right-command 71
! right-menu 118

clear Mod1
keycode 118=Alt_L
add Mod1 = Alt_L

clear Mod2
keycode 66=Meta_L
keycode 69=Meta_R
add Mod2 = Meta_L Meta_R

clear Mod4
keycode 63=Super_L
keycode 71=Super_R
add Mod4 = Super_L Super_R

The key to figuring out the keycode is to use a command xev and it prints out all of events to stdout. Run it in xterm, press keys, and you can see what X wants.

I thought that Mod1 is the Meta, but somehow it didn’t work. I used Mod2 for Meta. Mod4 is Super.

My fingers are extremely happy to use Emacs under Xquartz at last.

One thought on “MacOS X Xquarz and xmodmap”

Leave a Reply

Your email address will not be published. Required fields are marked *