next up previous contents index
Next: Microsoft Windows Notes Up: Apple OS X Notes Previous: MacBook Keyboard Mapping Issues   Contents   Index

The Alt Key Issue

The MacBook Pro and probably other Mac machines lack a compatible Alt key. This Alt key is used in Xic as a menu accelerator, and for a button-press modifier. It is reasonable to live without it, but there is a fix.

The following fix works on my MacBook Pro. Create a file in your home directory named ``.Xmodmap'' containing the following two lines:

keycode 66 = Alt_L
add mod1 = Alt_L

This will map the left ``option'' button to Alt. The right option button will still do the normal Mac thing, i.e., send alternate character keycodes.

However, this depends on the left option key returning scan code 66, which may not be true on different hardware. The xev program can be used to find the actual scan code.

This will apply to all X applications, and the mapping will be recorded when the X server starts. You can also give the command

xmodmap -e "keycode 66 = Alt_L" -e "add mod1 = Alt_L"
which will re-map the keys for the current X session.


next up previous contents index
Next: Microsoft Windows Notes Up: Apple OS X Notes Previous: MacBook Keyboard Mapping Issues   Contents   Index
Stephen R. Whiteley 2022-05-28