XChangeKeyboardMapping function, used by xmodmap, cannot reassign keycode when NoSymbol is used in some position in the xkb/symbols entries. See url for a detailed explanation. FOLLOWUP on the bottom of the page details current info.
Sorry about the phenomenal bug spam, guys. Adding xorg-team@ to the QA contact so bugs don't get lost in future.
English portions copied from URL for future reference: Let's take an example of changing the "f" key to produce and "x" and an "X" with AltGr and Shift+AltGr. NoSymbol: If a position is marked with NoSymbol, the key produces "f" and "F" when pressed with AltGr and Shift+AltGr, respectively. If we change the settings with "xmodmap -e 'f F x X x X', the values get changed properly if we look them up with "xmodmap -pk." However, if we try pressing the key, an "f" and "F" are produced, not the new values. This seems to be a bug. VoidSymbol: If we use VoidSymbol, the key doesn't produce anything when pressed with AltGr or Shift+AltGr. If we change the settings with "xmodmap -e 'f F x X x X', the values get changed properly both for "modmap -pk" and for keyboard output as well. I.e. if we press AltGr+f and Shift+AltGr+f, we get an "x" and an "X," as we should. Arguments in favor of NoSymbol: -With NoSymbol, if AltGr is held down, the key produces the same character as it does without modifiers ("f" in our case). With VoidSymbol, pressing the key with AltGr down produces nothing. Arguments in favor of VoidSymbol: -xmodmap can be used to change keys set with VoidSymbol; NoSymbol makes the key unreassignable with xmodmap. -We can produce the same character as without modifiers by specifying it explicitly. In our case we could specify f and F for all positions. FOLLOWUP: When using NoSymbol, the symbol list is "truncated" when NoSymbol is used. Explained below through examples: 1. Not truncated: key { [ f, F, VoidSymbol, VoidSymbol ] }; 2. Not truncated: key { [ f, F, NoSymbol, VoidSymbol ] }; 3. Not truncated: key { [ f, F, VoidSymbol, NoSymbol ] }; 4. Truncated: key { [ f, F, NoSymbol, NoSymbol ] }; 5. Truncated: key { [ f, F, NoSymbol ] }; 6. Truncated: key { [ f, F ] }; The problem is not with xmodmap, but in xlib's XChangeKeyboardMapping() or XLookupString() function. I wrote a little test app and set the values there with XChangeKeyboardMapping(), which is what xmodmap does as well. I then read the values with XLookupString(), as xev does. I got the same behavior as xmodmap and xev, so the problem is in these library functions, not the utilities.
Mass closure: This bug has been untouched for more than six years, and is not obviously still valid. Please reopen this bug or file a new report if you continue to experience issues with current releases.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.