Details
Description
In qtwebengine some keymaps of xkb are kind of ignored or more precisely double trigger the keysym action and the keybind action.
For context I come from this issue on qutebrowser as it appears to be a general issue of qtwebengine, as I could reproduce in both Falkon and Konqueror but not in the qutebrowser command prompt, or Kate or Konsole.
I'll copy some of the parts of above mentioned qutebrowser issue in a sumarizing manor:
Context
May Laptop (Lenovo Carbon X1 Gen2) has very oddly Home and End keys where usually the Caps Lock would be.
As I also use a custom xkb map which is based on the German Neo layout (see below) I have rebound these keys to ISO_Level3_Switch.
The bug
In qtwebengine both actions trigger the Home/End scrolling to the tob/bottom or moving the cursor AND the layer switch; it happens in qt5 and qt6.
Expected Behaviour
qtwebengine should respect the system remap of keys in favor of falling back to keysyms, except otherwise configured explicitly.
How to reproduce*
This shoul be a minimal layout to reproduce this issue (copied from https://nixos.org/manual/nixos/stable/#custom-xkb-layouts slightly modified; more info about my actually use layout can be found in the original issue at qutebrowsers github):
xkb_symbols "qutebrowser-bug" { include "us(basic)" // includes the base US keys, you might want to replace this with your usually used layout include "level3(ralt_switch)" // configures right alt as a third level switch // This is the `Ä` key on a QUERTZ keyboard key <AC11> \{ type[Group1]="ONE_LEVEL", symbols[Group1] = [ ISO_Level3_Shift ] } ; // The following two lines are only for the Lenovo X1 carbon Gen 2, as it places `Home` and `End` in the spot of `Caps_Lock` key <END> { type[Group1]="ONE_LEVEL", symbols[Group1] = [ ISO_Level3_Shift ] }; key <HOME> { type[Group1]="ONE_LEVEL", symbols[Group1] = [ ISO_Level3_Shift ] }; key <LatA> { [ a, A, Greek_alpha ] }; key <LatB> { [ b, B, Greek_beta ] }; key <LatG> { [ g, G, Greek_gamma ] }; key <LatD> { [ d, D, Greek_delta ] }; key <LatZ> { [ z, Z, Greek_zeta ] }; };
After putting this in `/usr/share/X11/xkb/symbols/custom` you should be able to set this layout with `setxkbmap custom qutebrowse-bug`.
For further reference this is the output of `xev -events keyboard` (key seqence `Ä` `End` `Home` `CTRL-C`):
Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml✦ >>> nix-shell -p xorg.xev --run 'xev -events keyboard' Outer window is 0x6e00001, inner window is 0x6e00002 KeymapNotify event, serial 24, synthetic NO, window 0x0, keys: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 KeyPress event, serial 25, synthetic NO, window 0x6e00001, root 0x40d, subw 0x0, time 22560001, (-559,823), root:(724,881), state 0x0, keycode 48 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False KeyRelease event, serial 28, synthetic NO, window 0x6e00001, root 0x40d, subw 0x0, time 22560081, (-559,823), root:(724,881), state 0x80, keycode 48 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False KeyPress event, serial 28, synthetic NO, window 0x6e00001, root 0x40d, subw 0x0, time 22566367, (-559,823), root:(724,881), state 0x0, keycode 110 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES, XKeysymToKeycode returns keycode: 48 XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False KeyRelease event, serial 28, synthetic NO, window 0x6e00001, root 0x40d, subw 0x0, time 22566509, (-559,823), root:(724,881), state 0x80, keycode 110 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES, XKeysymToKeycode returns keycode: 48 XLookupString gives 0 bytes: XFilterEvent returns: False KeyPress event, serial 28, synthetic NO, window 0x6e00001, root 0x40d, subw 0x0, time 22567271, (-559,823), root:(724,881), state 0x0, keycode 115 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES, XKeysymToKeycode returns keycode: 48 XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False KeyRelease event, serial 28, synthetic NO, window 0x6e00001, root 0x40d, subw 0x0, time 22567405, (-559,823), root:(724,881), state 0x80, keycode 115 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES, XKeysymToKeycode returns keycode: 48 XLookupString gives 0 bytes: XFilterEvent returns: False ^C
I am also aware of QTBUG-102640 and QTBUG-82856, not sure if there is still an active dupe of this that I have missed.