10.4: Break the correct behaviour of keybindings in X11

Jul 28, '05 08:31:00AM

Contributed by: Anonymous

Tiger only hintI've been using nedit under X11 on MacOS X for a long time. After upgrading to 10.4, I noted that now the Alt key really did work as the Alt key, which it didn't under 10.3. One might probably ask why this is newsworthy at all. Well, if you're using an international keyboard (like me), you've got to type Alt-L to get the '@' symbol (this is a bit awkward at the beginning, but you get quickly used to it).

However, with Alt-L really working as the modifier key under 10.4, Alt-L is a keyboard shortcut to open the 'Shell' menu in nedit. As I'm using nedit mainly for perl programming, this behaviour is annoying (to say the least), as you need the '@' for array variables. I tried to switch back to the old (admittedly incorrect) behaviour using X11.app's preferences. But switching off "Use the system keyboard layout" as well as "Enable keyboard shortcuts" wasn't sufficient. I also needed to put a .Xmodmap file into my home folder containing the following lines:

remove mod1 = Mode_switch
remove mod2 = Meta_L
add mod2 = Mode_switch
add mod1 = Meta_L
This will swap the command key and the alt key for all X11 programs. So you keep the menu shortcuts (only use Command instead of Alt), and you can still type all those strange symbols which you can usually reach via the Alt key (@,€,¥, etc.) without invoking a menu.

Comments (2)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050721143125811