Thursday, November 09, 2006

Making the Apple Command Key work Properly in Linux

This post explains how to get the Apple Command key to behave like an Alt key; and how to configure Firefox to use the Alt key instead of the Control key as its accelerator key. The goal is to get Firefox and the Apple Command key to work similarly under both Mac OS X and Linux.

Map Command Key to Alt. Add the following lines to ~/.xmodmaprc.
! Set the left Apple key act as an alt key.
keycode 115 = Alt_L Meta_L
add mod1 = Alt_L Meta_L
The following command enacts these changes.
xmodmap .xmodmaprc
(These changes can be set to begin at boot time. Gnome notices the files and will ask you if you want to use it. There is an earlier post here on getting it to work in XFce4.)

Change Accelerator Key in Firefox. Launch Firefox. Type about:config in the location bar and hit enter. Set the following two attributes as follows.
ui.key.accelkey 18
ui.key.menuAccessKey 0
The first defines the accelerator key to be the Alt key, while the second disables accessing the menu from the keyboard, which is the usual behaviour for the Alt key.

Now restart Firfox. The menus should reflect the change by reading "Alt+" instead of "Ctrl+" in defining the shortcuts.