Fix broken shift+down/up/8/= in X11 and KDE

Apr 19, '04 09:07:00AM

Contributed by: toaster_boy

I had the following X11 keymap problem in KDE applications like Kate (Emacs, xterm, and xev all exhibited the expected behavior):

An existing hint suggested using:
xmodmap -e "keycode 78 = Left"
xmodmap -e "keycode 74 = Right"
in my xinitrc, but that didn't completely fix the problem. After lots of research and experimentation, I discovered a solution: The default keymap shipped with my X11.app has entries for several keycodes the PowerBook keyboard cannot generate. Apparently KDE (probably Qt in truth) examines the keycode entries in ascending order and gets confused, since it finds the spurrious entries first. The solution, then, is to delete the spurious entries. First, save a copy of the keymap:
 $ xmodmap -pke > fixedmap
Then, find the following lines in the file oldmap and delete everything after the equal sign.
keycode 74 = Right asterisk
keycode 78 = Right plus
keycode 80 = Down equal
keycode 85 = Up slash
Save the modified file as ~/.Xmodmap and restart X11.app. Note: for some reason, this didn't work right away. I made some trial edits to /etc/X11/xinit/xinitrc to find out why, and it started working; removed my changes and it still works. Maybe you just have to touch /etc/X11/xinit/xinitrc.

I own a Al PowerBook G4 15" running Panther. I use Apple's X11.app, and my KDE is 3.2.1 from unstable fink. It's possible this solution is only necessary under that configuration.

Comments (5)


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