GNOME Bugzilla – Bug 764825
[WAYLAND] Fn key resets scrolling
Last modified: 2016-04-27 13:07:26 UTC
In the terminal on X11 I can scroll up/down with Fn-Shift-Up/Down. Fn seems to be considered as a modifier key, so it doesn't have any effect on its own. And I can happily press it after having scrolled up, it doesn't have any effect. On wayland unfortunately, pressing Fn resets the scroll to the bottom. This is a bit annoying because a number of other keybindings (like cycle through tabs Fn-Ctrl-Left/Right) also use that key. This might be a Gtk+ bug.
I think this is another case of xkb-common being inconsistent on what it actually consumes as a modifier than GDK on X11 (GDK-X11 has its own internal copy of an Xlib function) — see bug 754110.
(In reply to Emmanuele Bassi (:ebassi) from comment #1) > I think this is another case of xkb-common being inconsistent on what it > actually consumes as a modifier than GDK on X11 (GDK-X11 has its own > internal copy of an Xlib function) — see bug 754110. Not really; Fn isn't a modifier because it doesn't apply any modifications in an xkbcommon sense. Fn-shifting is performed in the kernel (drivers/hid/hid-apple.c), and we don't do anything with it in userspace. We return a key with zero levels and no information about it, which is pretty accurate. Our gut feeling is that either GTK+ should be suppressing the event if it knows nothing of it, or VTE should be ignoring it. Discussion: https://github.com/xkbcommon/libxkbcommon/issues/34
It probably makes more sense to have that in vte.
I see no define for the "Fn" key in gdkkeysyms.h. If there is none, it needs to be added first before I can add it to the list of modifiers that vte checks.
It is mapped to NoSymbol.
Is there anything else getting mapped to NoSymbol ? Or do you think anything mapped to NoSymbol should get the same treatment as Fn ?
I'd suggest anything else producing NoSymbol get ignored: by definition, you don't know what it is, so it can produce no useful output.
There's no GDK_KEY_NoSymbol; do you mean GDK_KEY_VoidSymbol maybe?
Created attachment 326862 [details] [review] wayland: Ignore NoSymbol keys NoSymbol is not a valid GDK symbol (it only has the concept of VoidSymbol, for some reason, which is neither the same thing nor produced by any sane keymap). Passing NoSymbol events through to GTK+ apps is unlikely to produce anything useful. In particular, this meant VTE would scroll to the end of the buffer when pressing Fn (required for Page Up/Down on Macs), as it was receiving a keypress that wasn't a modifeir. This does not happen on X11, as the KEY_FN keycode is above 255, so does not get sent to clients.
OK, turns out this is actually a Wayland-backend bug, as other backends don't appear to transmit NoSymbol keysyms. I've attached the patch, but can't reassign because I don't have privileges.
Re-assigning
Review of attachment 326862 [details] [review]: Looks good to me. Would be good to cherry-pick to gtk-3-20 as well.
Attachment 326862 [details] pushed as 210a747 - wayland: Ignore NoSymbol keys