I try to make some changes in my keyboard configuration with xmodmap. However, when I look at the output of

xmodmap -pke

I see that some keycodes are binded to 12 KEYSYM, for example, with my french keyboard:

keycode  21 = equal plus equal plus braceright dead_abovering braceright dead_abovering equal plus braceright dead_abovering

In all the manual I found about xmodmap configuration, I found nowhere the possibility of attributing 12 KEYSYM to one single keycode. Xmodmap seems to be quite old and various generation of manuals and tutorials gives different meanings to KEYSYM positions. How can I find out from xmodmap itself which modifier or modifier combination corresponds to each position in the KEYSYM list?

up vote 0 down vote accepted

On Ubuntu 14.04, I've been able to reach 10 positions. I had to add Mode_switch, ISO_Level3_Shift and ISO_Next_Group to my keyboard.

  1. no modifier
  2. Shift
  3. Mode_switch
  4. Shift + Mode_switch
  5. ISO_Level3_Shift
  6. Shift + ISO_Level3_Shift
  7. 2×ISO_Next_Group
  8. 2×ISO_Next_Group + Shift
  9. 2×ISO_Next_Group + Mode_switch = 3×ISO_Next_Group
  10. 2×ISO_Next_Group + Mode_switch + Shift = 3×ISO_Next_Group + Shift

You may want to read: http://www.in-ulm.de/~mascheck/X11/xmodmap.html

  • 1
    Very interesting link! – Antoine Gallix Feb 22 '15 at 18:48
  • There is indeed so many mysteries in the keyboard... For example my F10 is mapped to 20 positions. > keycode 73 = F7 F7 F7 F7 F7 F7 XF86Switch_VT_7 F7 F7 XF86Switch_VT_7 F7 F7 F7 F7 XF86Switch_VT_7 F7 F7 F7 F7 XF86Switch_VT_7 --- Additionally, although Fn can not be recognized by the Ubuntu itself, the combination Fn+F7 is mapped to 8 other positions (extendable to 10). > keycode 174 = XF86AudioStop XF86Eject XF86AudioStop XF86Eject XF86AudioStop XF86Eject XF86AudioStop XF86Eject --- So if I've been fool, I might map F7 to 20 different keys. – Edvard Rejthar Mar 3 '15 at 11:18

As per the man page of xmodmap:

Up to eight keysyms may be attached to a key, however the last four are not used in any major X server implementation. The first keysym is used when no modifier key is pressed in conjunction with this key, the second with Shift, the third when the Mode_switch key is used with this key and the fourth when both the Mode_switch and Shift keys are used.

I assume that keysym in position 5 to 8 (or in my case 12) are triggered by Mod1-5 and some other mysterious key, and therefore almost never used.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.