[Xquartz-dev] left and right alt (option) keys

Merle Reinhart merlereinhart at mac.com
Sat Dec 8 07:38:28 PST 2007


I know a lot of discussion about alt and mode_select has gone on  
previously and I apologize if this has been discussed before.

The hardware:  I'm running on a MacPro with a US aluminum keyboard and  
the Mac OS X keyboard set to US.

What I'm noticing with the X11-2.1.0.pkg version installed is that the  
left alt/option key is seen by xev as the right alt/option key but  
software mapped to the left alt key.  The right alt/option key is seen  
as the right alt, but software mapped to the left alt key.

In Tiger's X11, the left alt was keycode 66 and the right alt was  
keycode 69 as I'd expect.
Here is xev with the left alt:
KeyPress event, serial 22, synthetic NO, window 0x600001,
     root 0x57, subw 0x0, time 77250, (42,123), root:(42,167),
     state 0x0, keycode 66 (keysym 0xff7e, Mode_switch), same_screen  
YES,
     XLookupString gives 0 bytes:
     XmbLookupString gives 0 bytes:
     XFilterEvent returns: False


In Leopard with the 1.2a set of installs (installed by Jeremy's  
x11_update.sh script), the left alt again was keycode 66 and the right  
was 69 again as expected.
Here is the xev output with the left alt:
KeyPress event, serial 23, synthetic NO, window 0x200001,
     root 0x3f, subw 0x0, time 2993881147, (53,94), root:(53,138),
     state 0x0, keycode 66 (keysym 0xff7e, Mode_switch), same_screen  
YES,
     XLookupString gives 0 bytes:
     XmbLookupString gives 0 bytes:
     XFilterEvent returns: False


In Leopard with the X11-2.1.0.pkg installed and post-reboot, things  
are rather different.
Here is the xev output with the left alt:
KeyPress event, serial 24, synthetic NO, window 0x200001,
     root 0x3f, subw 0x0, time 3126321031, (101,88), root:(101,132),
     state 0x0, keycode 69 (keysym 0xff7e, Mode_switch), same_screen  
YES,
     XKeysymToKeycode returns keycode: 66
     XLookupString gives 0 bytes:
     XmbLookupString gives 0 bytes:
     XFilterEvent returns: False

Here is the xev output with the right alt:
KeyPress event, serial 27, synthetic NO, window 0x200001,
     root 0x3f, subw 0x0, time 3126373406, (52,84), root:(52,128),
     state 0x0, keycode 69 (keysym 0xff7e, Mode_switch), same_screen  
YES,
     XKeysymToKeycode returns keycode: 66
     XLookupString gives 0 bytes:
     XmbLookupString gives 0 bytes:
     XFilterEvent returns: False


So, something looks strange to me that by default the left alt/option  
key returns the keycode of the right alt/option key but then is mapped  
back to the left alt/option key.


The real reason I was even looking at this was I use nedit a lot, so  
having Alt work is a major workflow advantage.  Alt worked fine in  
Tiger without any modifications by me.  In Leopard, Alt doesn't work  
without xmodmap modifications, but mode_switch does.
Anyway, I'm working around my problem by mapping keycode 66 to Alt_L  
and keycode 69 to Alt_R with xmodmap (I lose mode_switch, but I have  
never used it anyway other than two weeks I was in Sweden using a  
borrowed computer).

Merle

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2425 bytes
Desc: not available
Url : http://lists.macosforge.org/pipermail/xquartz-dev/attachments/20071208/df3213e2/smime.bin


More information about the Xquartz-dev mailing list