Bug 402764 - Caps Lock as additional Super does not trigger Alt+F1 shortcut
Summary: Caps Lock as additional Super does not trigger Alt+F1 shortcut
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: input (show other bugs)
Version: 5.12.7
Platform: Kubuntu Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL: https://phabricator.kde.org/D17967
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-01 19:29 UTC by Dalton Durst
Modified: 2019-01-05 07:57 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.14.5
mgraesslin: Wayland-
mgraesslin: X11+
mgraesslin: ReviewRequest+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dalton Durst 2019-01-01 19:29:00 UTC
SUMMARY

When "Make Caps Lock an additional Super" is enabled in Keyboard > Advanced > Caps Lock behavior, pressing Caps Lock once (to create a Super keypress) does not trigger the ALT+F1 shortcut to (by default) open the application launcher. 

STEPS TO REPRODUCE
1. Enable "Make Caps Lock an additional Super" in Keyboard > Advanced > Caps Lock behavior and apply the changes
2. Verify that tapping the real Super key on the keyboard raises the Application Launcher.
3. Tap the Caps Lock key to send a Super keypress

OBSERVED RESULT

The Application Launcher does not appear. However, shortcuts which use Super as a modifier key (such as Meta+T) work correctly.

EXPECTED RESULT

The Application Launcher appears

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 18.04
(available in About System)
KDE Plasma Version: 5.12.7
KDE Frameworks Version: 5.44.0
Qt Version: 5.9.5

I can work around this issue by setting the application launcher to a different multi-key shortcut, such as Meta+Space.
Comment 1 Martin Flöser 2019-01-02 04:53:48 UTC
Please use xev to compare the key events of the real and fake super key.
Comment 2 Dalton Durst 2019-01-04 02:22:51 UTC
Sure. Here's a Caps Lock press:


>KeyPress event, serial 50, synthetic NO, window 0x4a00001,
>    root 0x5d5, subw 0x0, time 567230, (64,-10), root:(64,791),
>    state 0x0, keycode 66 (keysym 0xffeb, Super_L), same_screen YES,
>    XLookupString gives 0 bytes: 
>    XmbLookupString gives 0 bytes: 
>    XFilterEvent returns: False
>
>KeyRelease event, serial 50, synthetic NO, window 0x4a00001,
>    root 0x5d5, subw 0x0, time 567654, (64,-10), root:(64,791),
>    state 0x40, keycode 66 (keysym 0xffeb, Super_L), same_screen YES,
>    XLookupString gives 0 bytes: 
>    XFilterEvent returns: False


And here's a real Super key:


>KeyPress event, serial 50, synthetic NO, window 0x4a00001,
>    root 0x5d5, subw 0x0, time 570606, (64,-10), root:(64,791),
>    state 0x0, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
>    XKeysymToKeycode returns keycode: 66
>    XLookupString gives 0 bytes: 
>    XmbLookupString gives 0 bytes: 
>    XFilterEvent returns: False
>
>KeyRelease event, serial 51, synthetic NO, window 0x4a00001,
>    root 0x5d5, subw 0x0, time 570782, (64,-10), root:(64,791),
>    state 0x40, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
>    XKeysymToKeycode returns keycode: 66
>    XLookupString gives 0 bytes: 
>    XFilterEvent returns: False
Comment 3 Martin Flöser 2019-01-04 05:28:38 UTC
Could you please try to restart KWin? It's possible that we do not get informed about keymap changes.
Comment 4 Dalton Durst 2019-01-04 16:35:02 UTC
I ran the following in  a terminal to replace KWin:

> DISPLAY=:0 kwin --replace

Then went back to the VT with my desktop session. The Caps Lock key still did not operate as a Super key. Running xev again shows the same output as before for both keypresses.
Comment 5 Martin Flöser 2019-01-04 17:07:38 UTC
I just tried to add the same config in my Wayland session and there it works without any problems. Thus this seems to be an X11 specific problem.
Comment 6 Martin Flöser 2019-01-04 17:40:46 UTC
Possible, but untested patch: https://phabricator.kde.org/D17967
Comment 7 Dalton Durst 2019-01-04 22:10:30 UTC
I can confirm that it works as expected in a Wayland session.

It looks like that patch was accepted -- is there anything else that I should do until it lands? I don't have a build environment for KWin...
Comment 8 Martin Flöser 2019-01-05 07:33:32 UTC
No, there's no nothing to do.
Comment 9 Martin Flöser 2019-01-05 07:57:56 UTC
Git commit 0f489c3521eb5f19459b4210911548237e0655b6 by Martin Flöser.
Committed on 05/01/2019 at 07:57.
Pushed by graesslin into branch 'Plasma/5.14'.

[platforms/x11/standalone] Pass kxkbconfig to Xkb prior to reconfigure

Summary:
This ensures that KWin gets the same keyboard layout config as is
configured in the session and not a default config.
FIXED-IN: 5.14.5

Test Plan:
Xephyr to verify the config is applied, otherwise completely
untested. I don't have an X session.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17967

M  +1    -0    plugins/platforms/x11/standalone/x11_platform.cpp

https://commits.kde.org/kwin/0f489c3521eb5f19459b4210911548237e0655b6