Bug 9254 - XChangeKeyboardMapping, xmodmap cannot reassign keycode when NoSymbol is used
Summary: XChangeKeyboardMapping, xmodmap cannot reassign keycode when NoSymbol is used
Status: RESOLVED INVALID
Alias: None
Product: xorg
Classification: Unclassified
Component: Input/Keyboard (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL: http://kotoistus.tksoft.com/linux/voi...
Whiteboard:
Keywords:
Depends on:
Blocks: 9239
  Show dependency treegraph
 
Reported: 2006-12-05 07:46 UTC by Troy Korjuslommi
Modified: 2018-06-12 19:08 UTC (History)
5 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Troy Korjuslommi 2006-12-05 07:46:51 UTC
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.
Comment 1 Daniel Stone 2007-02-27 01:35:00 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 2 Alan Coopersmith 2009-09-01 07:39:47 UTC
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.
Comment 3 Adam Jackson 2018-06-12 19:08:27 UTC
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.