< Back

Alt key does not work on Mac


Problem:

The keyboard functions that require the Alt key do not work on Mac

Solution:

This is because Apple’s X11 X server does not treat the Command or the Option key as an Alt key (despite the fact that the Option key also says alt on it). The workaround is to add the following command to file /etc/X11/xinit/xinitrc:

xmodmap -e keycode 63 = Alt_L

This will make the Command key the Alt key. If you add this line instead:

xmodmap -e keycode 66 = Alt_L

this will make the Option key the Alt key. You can also do this in an xterm. Alt-clicking with the Command key will still work–Tecplot for the Mac treats Alt-clicks and Meta-clicks the same.┬áTo use either key as an Alt key requires 3-button mouse emulation to be turned off. See the related post for information on how to do this.