Bug 375355 - Meta/Modifier only shortcuts don't work when CapsLock is on
Summary: Meta/Modifier only shortcuts don't work when CapsLock is on
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: input (show other bugs)
Version: 5.8.5
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL: https://phabricator.kde.org/D4241
Keywords:
: 375356 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-01-21 03:53 UTC by Chris Holland
Modified: 2017-01-25 12:39 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.8.6
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 Chris Holland 2017-01-21 03:53:31 UTC
First noticed by /u/artingence on reddit.
https://www.reddit.com/r/kde/comments/5ovjqu/super_key_meta_not_working_anymore/dco06ip/

Couldn't find an existing bug report so I figured I'd make it. This could be working as intended for all I know.

We could change our logic to ignore capslock. Not sure if m_modifiers is used for other things, so we'd might need a second property that is only used for mod only shortcut checking.
https://github.com/KDE/kwin/blob/master/keyboard_input.cpp#L348


We could bind Shift+Meta, Shift+Ctrl, Shift+Alt when reading from the config.
https://github.com/KDE/kwin/blob/master/options.cpp#L847
Comment 1 Martin Flöser 2017-01-21 07:05:46 UTC
We do have support for caps lock in modifier only shortcuts. Even with an unit test.

So the question is rather why it doesn't work for you. Which keyboard layout are you using?
Comment 2 Christoph Feck 2017-01-21 12:49:51 UTC
*** Bug 375356 has been marked as a duplicate of this bug. ***
Comment 3 Chris Holland 2017-01-21 16:35:03 UTC
System Settings is set to "Generic 101-Key PC". This is probably the default because I skipped through that screen in the KDE Neon OS installer.

My actual keyboard is a cheap $20 thing from staples.

https://i.imgur.com/CKYkZSx.jpg
https://i.imgur.com/d0NGtEL.jpg
https://i.imgur.com/JBuYKza.jpg

xev of pressing CapsLock (on) then Super_L, then CapsLock (off) then Super_L https://paste.kde.org/pqa1am4mi
Nothing interesting there.
Comment 4 Martin Flöser 2017-01-21 17:31:14 UTC
I just realized that our unit test verifies a different behavior. That is: don't trigger shift shortcut on caps lock.

Now trusting meta on caps lock sounds sensible in general. Though I won't promise that we can fix it for 5.8.
Comment 5 Martin Flöser 2017-01-21 19:16:38 UTC
Git commit 5dc942ac5e3611ae7db8f2902bb092b66920edeb by Martin Gräßlin.
Committed on 21/01/2017 at 19:13.
Pushed by graesslin into branch 'Plasma/5.9'.

[autotests] Add test case for modifier only trigger when capslock enabled

This extends the testCapsLock to ensure that modifier only shortcut
trigger when capslock is enabled. So far the test only ensured that
capslock doesn't trigger the shift modifier only shortcut.

As the test shows currently when capslock is on, the meta key doesn't
trigger any more.

This test case goes into Plasma/5.9 branch and not in Plasma/5.8 as a
fix will most likely need the new xkbcommon 0.7 code paths which we do
not have in Plasma/5.8.

M  +16   -1    autotests/integration/modifier_only_shortcut_test.cpp

https://commits.kde.org/kwin/5dc942ac5e3611ae7db8f2902bb092b66920edeb
Comment 6 Martin Flöser 2017-01-22 08:42:18 UTC
Git commit 0acfebd96bace0fefd7c4291617f1d07f96ca03e by Martin Gräßlin.
Committed on 22/01/2017 at 08:42.
Pushed by graesslin into branch 'Plasma/5.8'.

[autotests] Add test case for modifier only trigger when capslock enabled

This extends the testCapsLock to ensure that modifier only shortcut
trigger when capslock is enabled. So far the test only ensured that
capslock doesn't trigger the shift modifier only shortcut.

As the test shows currently when capslock is on, the meta key doesn't
trigger any more.

M  +17   -1    autotests/integration/modifier_only_shortcut_test.cpp

https://commits.kde.org/kwin/0acfebd96bace0fefd7c4291617f1d07f96ca03e
Comment 7 Martin Flöser 2017-01-25 12:39:34 UTC
Git commit 5a87fa3f92cfc29944b8dc66c2320e3062b532ee by Martin Gräßlin.
Committed on 25/01/2017 at 12:39.
Pushed by graesslin into branch 'Plasma/5.8'.

Support modifier-only-shortcuts when capslock is on

Summary:
So far we didn't trigger modifier-only-shortcuts when capslock was
enabled. In fact we even ensured that the shortcuts did not trigger.
This seems not to be what our users expect. Meta should still trigger
if capslock is on.

This change modifies the logic to determine which modifier is currently
pressed by using the modifiersRelevantForGlobalShortcuts. The difference
to the "normal" modifiers is that this excludes capslock from modifiers
and excludes consumed modifiers. The latter is not really relevant as
modifier-only-shortcuts do not trigger if multiple keys are pressed,
which is required to have a modifier consumed.
FIXED-IN: 5.8.6

Test Plan: Only with adjusted autotest

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

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

M  +14   -8    autotests/integration/modifier_only_shortcut_test.cpp
M  +3    -3    keyboard_input.cpp

https://commits.kde.org/kwin/5a87fa3f92cfc29944b8dc66c2320e3062b532ee