ISO_Level3_Shift vs Mode_switch (was: Howto handle modified keys)
Glynn Clements
glynn at gclements.plus.com
Fri Oct 20 15:15:52 PDT 2006
Edgar Toernig wrote:
> Anyway, there's still the oddity that a single key (AltGr) sometimes
> gives different symbols when pressed (Mode_switch) and released (ISO_-
> Level3_Shift). Apparently, not only apps are confused on how the AltGr
> key is called - even the xkb keymap authors can't agree on its mapping
> giving such strange results *g*
You can typically cause that situation with e.g.:
xmodmap -e 'keycode 113 = Mode_switch Multi_key ISO_Level3_Shift Multi_key'
Because Mode_shift switches groups, the key is called Mode_switch in
one group (when it isn't pressed), and ISO_Level3_Shift in another
group (when it is pressed).
You can get similar behaviour for any key whose keysyms are affected
by Mode_switch, e.g.:
1. Press AltGr
2. Press [ (you get KeyPress:dead_diaeresis)
3. Release AltGr
4. Release [ (you get KeyRelease:bracketleft)
Not really surprising if you think about it: the keysym for the
KeyRelease event depends upon the the modifiers at the time the key is
released, not when the key was originally pressed.
AltGr isn't any different in this regard, except that the same key is
controlling both the keycode and the modifier state. If you don't give
the keycode different keysyms in different groups, you shouldn't have
any problems.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the xorg
mailing list