GNOME Bugzilla – Bug 346029
KeyRelease for Alt key broken after adding keyboard layout
Last modified: 2007-08-24 15:40:49 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.
*** Bug 345726 has been marked as a duplicate of this bug. ***
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?
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.
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.
*** Bug 457288 has been marked as a duplicate of this bug. ***