Shift + F12 keys don't work in any program

Bug #1274087 reported by Matthew Moore
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Unity
New
Undecided
Unassigned
xkeyboard-config
Fix Released
High
unity (Ubuntu)
New
Undecided
Unassigned

Bug Description

Description: Ubuntu 12.04.4 LTS
Release: 12.04

byobu:
  Installed: 5.17-0ubuntu1

Shift + F12 key combination doesn't work.

Normally in byobu Shift + F12 disables a specific setting, but it doesn't in 12.04

Also in a custom 4gl (Empress) application we have Shift + F12 normally opens a window, but it doesn't in 12.04.

Any other program that uses 12.04 has the same issue. I have tested this on 3 machines running 12.04.

Revision history for this message
In , Christoph Anton Mitterer (calestyo) wrote :

Hi.

This is forwarded from the mentioned Debian bug:

The new version seems to somehow break the F10 key.

When being in GNOME, and havin a gnome-terminal opened, e.g. aptitude running...
pressing F10 should cause aptitude's menu to open.

But now, aptitude's menu opens, as well as the context menu of the terminal itself.

Downgrading fixes the issue.

Cheers,
Chris.

Revision history for this message
In , Sergey V. Udaltsov (svu) wrote :

what does xev utility reports when you press f10?

Revision history for this message
In , Sven Joachim (svenjoac) wrote :

I'm having the same problem with gnome-terminal, here is the xev output:

KeyPress event, serial 33, synthetic NO, window 0x1400001,
    root 0x2b5, subw 0x0, time 11437053, (31,432), root:(964,458),
    state 0x0, keycode 76 (keysym 0xffc7, F10), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x1400001,
    root 0x2b5, subw 0x0, time 11437163, (31,432), root:(964,458),
    state 0x0, keycode 76 (keysym 0xffc7, F10), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

Revision history for this message
In , Sergey V. Udaltsov (svu) wrote :

But according to what I see - it is all correct, F10 produces F10.

What is xev output with the previous version of xkb-data?

> KeyPress event, serial 33, synthetic NO, window 0x1400001,
> root 0x2b5, subw 0x0, time 11437053, (31,432), root:(964,458),
> state 0x0, keycode 76 (keysym 0xffc7, F10), same_screen YES,
> XLookupString gives 0 bytes:
> XmbLookupString gives 0 bytes:
> XFilterEvent returns: False
>
> KeyRelease event, serial 33, synthetic NO, window 0x1400001,
> root 0x2b5, subw 0x0, time 11437163, (31,432), root:(964,458),
> state 0x0, keycode 76 (keysym 0xffc7, F10), same_screen YES,
> XLookupString gives 0 bytes:
> XFilterEvent returns: False

Revision history for this message
In , Sven Joachim (svenjoac) wrote :

With the previous xkb-data version (2.3), it's essentially the same:

KeyPress event, serial 33, synthetic NO, window 0x1600001,
    root 0x2b5, subw 0x0, time 13172000, (-269,319), root:(664,345),
    state 0x0, keycode 76 (keysym 0xffc7, F10), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x1600001,
    root 0x2b5, subw 0x0, time 13172097, (-269,319), root:(664,345),
    state 0x0, keycode 76 (keysym 0xffc7, F10), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

Revision history for this message
In , Sergey V. Udaltsov (svu) wrote :

Well, in that case God knows why gnome-terminal behaves differently.

Ok, one more thing. Could you please do 'xkbcomp :0 -xkb out.xkb' for both new and old versions? Attach the result here

Revision history for this message
In , Sven Joachim (svenjoac) wrote :

Created attachment 55894
xkbcomp output with xkb-data 2.3

Revision history for this message
In , Sven Joachim (svenjoac) wrote :

Created attachment 55895
xkbcomp output with xkb-data 2.5

Revision history for this message
In , Sergey V. Udaltsov (svu) wrote :

The definitions for F10 are different (I expected that, I did that change) - but they should not matter if the XKB events are identical (and they are!).

What I suspect is that some app (gnome-terminal?) somehow checks the key definition. Why? I have no idea. Something was hardcoded - some workaround, perhaps - there was an issue with functional keys in 2.4. But xev output proves there is nothing to fix in xk-c

Revision history for this message
In , Christoph Anton Mitterer (calestyo) wrote :

It's a bit strange simply closing this... and btw: it's not only gnome-terminal that is affected...

Revision history for this message
In , Christoph Anton Mitterer (calestyo) wrote :

(Especially as it's clearly triggered by the new xkb-data version).

Revision history for this message
In , Sergey V. Udaltsov (svu) wrote :

Actually I am ready to reopen if you explain me what exactly would you like me to fix. The x11 (xev) events are absolutely identical - that is the limit of xk-c responsibility, for properly written SW. Is that ok with everybody?

If that's the case, the software is using some other information from XKB config - which is should not, I guess

Returning to the previous version of F10 definition is not an option because it had clearly broken semantics of things like Shift-F10.

So, what would you propose to do?

Revision history for this message
In , Christoph Anton Mitterer (calestyo) wrote :

Well has anyone some idea on whose door we should knock now?

I mean it's probably some GNOME/GTK wide keyboard library or so?

Revision history for this message
In , Sergey V. Udaltsov (svu) wrote :

I would start with gnome-terminal perhaps.

I am really sorry I cannot be of much help. When you open the bug in gnome bugzilla, could you please provide the link here in comments - so that I could participate in the discussion.

Thank you and sorry again.

Revision history for this message
In , Sergey V. Udaltsov (svu) wrote :

I just tried on my debian, F10 opens g-t menu, aptitide seems not getting it at all. Which is reasonable to some extent...

Revision history for this message
In , Sven Joachim (svenjoac) wrote :

To reproduce the problem, you need to configure gnome-terminal to pass F10 to the application. Under "Edit → Keyboard Shortcuts", uncheck "Enable the menu shortcut key (F10 by default)".

Revision history for this message
In , Sergey V. Udaltsov (svu) wrote :

Yes I can reproduce it. That just convinces me that g-t would be a good starting point - I do not know how g-t implements that feature...

Revision history for this message
In , Wettstein509 (wettstein509) wrote :

> The definitions for F10 are different (I expected that, I did that change) ->
> but they should not matter if the XKB events are identical (and they are!).

This is not completely true. The new definition of CTRL+ALT consumes Shift,
the old one does not. With the new definition, in a pedantic interpretation
of section 7.2.1 of the protocol specification of the X Keyboard Extension,
applications must not distinguish Shift-F10 and F10 anymore.

To see wether this is related to problem at hand, one could replace the
definition of CTRL+ALT (file in types/pc) with the following one:

   type "CTRL+ALT" {
 modifiers = Control+Alt+Shift+LevelThree;
        map[None] = Level1;
        map[Shift] = Level2;
        map[LevelThree] = Level3;
        map[Shift+LevelThree] = Level4;
 map[Control+Alt] = Level5;
 preserve[Shift] = Shift;
 preserve[Shift+LevelThree] = Shift;
 preserve[Shift+LevelThree+Alt] = Shift;
 preserve[Shift+LevelThree+Control] = Shift;
 preserve[Shift+LevelThree+Alt+Control] = Shift;
 preserve[Shift+Alt] = Shift;
 preserve[Shift+Alt+Control] = Shift;
 preserve[Shift+Control] = Shift;
        level_name[Level1] = "Base";
        level_name[Level2] = "Shift";
        level_name[Level3] = "Alt Base";
        level_name[Level4] = "Shift Alt";
 level_name[Level5] = "Ctrl+Alt";
    };

I do not have gnome on my machine, so I cannot test myself. Note that
the above definition is still not nice, but should be ok to check wether
consumed Shift is to blame.

> Returning to the previous version of F10 definition is not an option because it
> had clearly broken semantics of things like Shift-F10.

Do you have a pointer where the problems with the old definition are
described?

Revision history for this message
In , Sergey V. Udaltsov (svu) wrote :

> This is not completely true. The new definition of CTRL+ALT consumes Shift,
> the old one does not.
How does it affect the behavior of the F10 when shift is not pressed? As you can see, the events are exactly same.

> Do you have a pointer where the problems with the old definition are
> described?
https://bugs.freedesktop.org/show_bug.cgi?id=11822

Revision history for this message
In , Wettstein509 (wettstein509) wrote :

> How does it affect the behavior of the F10 when shift is not pressed? As you
> can see, the events are exactly same.

Basically, as Shift is consumed, one should not distinguish F10 and
Shift-F10. This means that pressing Shift-F10 should be handled like
pressing F10; or that pressing F10 should be handled like pressing
Shift-F10. So it is imaginable that consuming Shift assigns two functions
to pressing F10: the usual one for F10, plus the one for Shift-F10.

That is the idea. Whether it happens like this, I do not know. One has to
try or read the relevant source code. In any event, the original report
speaks about two actions triggered by F10...

Revision history for this message
In , Christoph Anton Mitterer (calestyo) wrote :

I've reassigned (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=656685#19) the Debian bug to the GNOME guys... hope they can point us to the right place.

Revision history for this message
In , Sven Joachim (svenjoac) wrote :

For the record, this has already been reported in GNOME's bugzilla at https://bugzilla.gnome.org/show_bug.cgi?id=661973.

Revision history for this message
In , Yevgen Muntyan (muntyan-fastmail) wrote :

Could someone take a look at gdk_x11_keymap_translate_keyboard_state () in http://git.gnome.org/browse/gtk+/tree/gdk/x11/gdkkeys-x11.c, and see if they are supposed to be broken? This bug is sitting for six month in the gnome bugzilla now, and it doesn't look like someone knows a definite answer as to what exactly is broken.

Revision history for this message
In , Matthias Clasen (mclasen) wrote :

I'm reopening this.
My own investigation confirms the finding in comment 17.
The xkeyboard-config changes in 2.4.1 make XKB translate Shift-F10 into F10 with level one, while telling my that the Shift modifier got consumed.

Revision history for this message
In , Matthias Clasen (mclasen) wrote :

Also note that xev output being identical is pretty irrelevant here, since xev only reports the core key events, not xkb data. that can be extracted from the combination of key events + xkb maps.

Revision history for this message
In , Matthias Clasen (mclasen) wrote :

    type "CTRL+ALT" {
        modifiers = Control+Alt+Shift+LevelThree;
        map[None] = Level1;
        map[Shift] = Level2;
        map[LevelThree] = Level3;
        map[Shift+LevelThree] = Level4;
        map[Control+Alt] = Level5;
        preserve[Shift] = Shift;
        preserve[Shift+LevelThree] = Shift;
        level_name[Level1] = "Base";
        level_name[Level2] = "Shift";
        level_name[Level3] = "Alt Base";
        level_name[Level4] = "Shift Alt";
        level_name[Level5] = "Ctrl+Alt";
    };

Here is a modified type for CTRL+ALT that works in my testing.
It is similar to the one in comment 17, but avoids blowing up the map with lots of new entries.

With this map, XkbTranslateKeyCode still translates Shift-F10 into F10 at level1, but the Shift modifier is now preserved, so GTK+ uses it when matching accelerators, and thus F10 and Shift-F10 can once again have different bindings.

Revision history for this message
In , Sergey V. Udaltsov (svu) wrote :

Thanks, that idea with preserve looks nice! Pushed.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1274087/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
tags: added: precise
affects: ubuntu → unity (Ubuntu)
Revision history for this message
Matthew Moore (matt-launchpad-v) wrote :

I have linked up this bug (and xkeyboard-config), as I think they are related:

https://bugs.freedesktop.org/show_bug.cgi?id=45008

I have fixed this by taking two packages from Saucy and installing them on the affected machines:

xkb-data_2.5.1-3ubuntu2_all.deb
xkb-data-i18n_2.5.1-3ubuntu2_all.deb

Which has fixed the issue we were having with Shift + F12. Hopefully it should be a small and easy fix to updated the versions in Precise. If I can help with that, just let me know.

Changed in xkeyboard-config:
importance: Unknown → High
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.