After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 346029 - KeyRelease for Alt key broken after adding keyboard layout
KeyRelease for Alt key broken after adding keyboard layout
Status: RESOLVED NOTGNOME
Product: gnome-control-center
Classification: Core
Component: Keyboard
2.14.x
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
: 345726 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-06-27 14:14 UTC by Raphaël Quinet
Modified: 2007-08-24 15:40 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14



Description Raphaël Quinet 2006-06-27 14:14:11 UTC
Short summary:
- Adding a new keyboard layout in the Keyboard Preferences
  (g-k-properties) automatically activates the option "Both Alt keys
  together change group" without notifying the user.
- An unwanted side-effect of this option is that it breaks the "Alt"
  keys.  The KeyPress events are sent correctly, but the KeyRelease
  events for Alt are mapped to the wrong key.  As a result, many
  applications do not detect that Alt has been released.

Similar problems occur if the options "Both Shift..." or "Both Ctrl
keys together..." are selected.  However, these options have to be
activated explicitely so they are probably not affecting many users.

System information:
- Laptop (HP/Compaq nc8000) running current Debian testing ("etch")
- GNOME 2.14.2
- X.Org 7.0
- The problem occurs with the built-in keyboard (US layout) as well as
  any external keyboard.
- Keyboard model in g-k-p: Generic 104-key PC.
- Selected layouts in g-k-p: U.S. English, Belgium, Sweden.

Steps to reproduce:
- If possible, start with a new user account or a clean session.
- Run "xev" or a similar X event monitoring application and verify
  that pressing and releasing the left Alt key generates KeyPress and
  KeyRelease events associated with the Alt_L key.
- In "Layout Options", "Group Shift/Lock behavior", check the option
  "Both Alt keys together change group" (this is activated
  automatically after adding a new keyboard layout).
- Run "xev" again and see that KeyPress still reports the Alt_L key,
  but KeyRelease reports another key (in my case, ISO_Prev_Group).
- This affects several applications that will be unable to detect that
  Alt has been released: GIMP (bug #345726), Inkscape, ...

Aggravating factor: the option "Both Alt keys together..." is silently
activated automatically after adding a second keyboard layout.
Removing the additional keyboard layout(s) does not solve the issue
because the option is not unchecked.

It was very difficult for me to find the source of this problem because
I never looked at the "Layout Options" tab after adding the second and
third keyboard layouts and I did not see (for several weeks) that some
option had changed there.  When I tried to track down this problem, I
saw that the bug was still there even after removing the additional
keyboard layouts (and thinking incorrectly that I went back to the
original state), so I wasted some hours investigating other potential
sources for this problem.  I am glad that I eventually found it by
creating new user accounts, adding panel applets and changing options
until the bug appeared again for these clean accounts.


Here is some additional details about what I get WITHOUT the option
"Both Alt keys together change group":

> xmodmap -pke | grep Alt
keycode  64 = Alt_L Meta_L
keycode 113 = Alt_R Meta_R ISO_Level3_Shift NoSymbol ISO_Level3_Shift
keycode 125 = NoSymbol Alt_L

> xev
[pressing and releasing Alt]
KeyPress event, serial 29, synthetic NO, window 0x2e00001,
    root 0x76, subw 0x0, time 365926274, (162,59), root:(171,454),
    state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 29, synthetic NO, window 0x2e00001,
    root 0x76, subw 0x0, time 365926863, (162,59), root:(171,454),
    state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes:


And here is what I get later, WITH the option activated:

> xmodmap -pke | grep Alt
keycode  64 = Alt_L ISO_Prev_Group ISO_Prev_Group NoSymbol ISO_Prev_Group
keycode 125 = NoSymbol Alt_L

> xev
KeyPress event, serial 29, synthetic NO, window 0x2e00001,
    root 0x76, subw 0x0, time 366201299, (162,54), root:(171,449),
    state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 29, synthetic NO, window 0x2e00001,
    root 0x76, subw 0x0, time 366201775, (162,54), root:(171,449),
    state 0x8, keycode 64 (keysym 0xfe0a, ISO_Prev_Group), same_screen YES,
    XLookupString gives 0 bytes:

Note that this also breaks the right Alt key, but fortunately I am not using
it as much as the left Alt key.
Comment 1 Raphaël Quinet 2006-06-27 14:20:23 UTC
*** Bug 345726 has been marked as a duplicate of this bug. ***
Comment 2 Sergey V. Udaltsov 2006-06-27 21:32:15 UTC
Actually, it is NOTGNOME. Could you please file in bugzilla.freedesktop.org against xkeyboard-config? BTW, do you use xorg's xkbdata or xkeyboard-config? Which version?
Comment 3 Raphaël Quinet 2006-06-28 15:03:09 UTC
OK, I will submit this to bugzilla.freedesktop.org and cross-reference it here when I'm done (no time to do it today).

I have the package xkb-data installed, from the xkeyboard-config project (at least that's what the package description says).  The version number is reported as 0.8 (or 0.8-5).  The top of the changelog file for this package contains an entry from you on 2006-03-05 about preparing the 0.8 release.
Comment 4 Raphaël Quinet 2007-08-24 10:59:33 UTC
I had forgotten to include the cross-reference in this bug report when I submitted the bug upstream.

Here it is:  https://bugs.freedesktop.org/show_bug.cgi?id=7430

See also the related bug #346752.
Comment 5 Raphaël Quinet 2007-08-24 15:40:49 UTC
*** Bug 457288 has been marked as a duplicate of this bug. ***