Support modifier-only-shortcuts when capslock is on
ClosedPublic

Authored by graesslin on Jan 22 2017, 8:49 AM.

Details

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.

BUG: 375355
FIXED-IN: 5.8.6

Test Plan

Only with adjusted autotest

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 10426.Jan 22 2017, 8:49 AM
graesslin retitled this revision from to Support modifier-only-shortcuts when capslock is on.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added reviewers: KWin, Plasma.
Restricted Application added a project: KWin. · View Herald TranscriptJan 22 2017, 8:49 AM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
davidedmundson added inline comments.
autotests/integration/modifier_only_shortcut_test.cpp
281

I don't get this change:

This is the " // this test verifies that Capslock does not trigger the shift shortcut" part of the test.

Shift has been released on line 276, so triggeredSpy shouldn't be going up.

graesslin added inline comments.Jan 25 2017, 9:32 AM
autotests/integration/modifier_only_shortcut_test.cpp
281

No, it is the capslock key which got released in 276. So at that point here capslock is on, typing an a would result in A.

So far when that was the case pressing shift did not trigger the modifier only shortcut, now it does.

davidedmundson accepted this revision.Jan 25 2017, 9:41 AM
davidedmundson added a reviewer: davidedmundson.
This revision is now accepted and ready to land.Jan 25 2017, 9:41 AM
This revision was automatically updated to reflect the committed changes.