Bug 335316 - false recognized Meta+/Windows-Key
Summary: false recognized Meta+/Windows-Key
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: master
Platform: openSUSE Linux
: NOR normal
Target Milestone: 1.0
Assignee: Sebastian Kügler
URL:
Keywords:
: 334445 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-05-25 08:06 UTC by Michael Werner
Modified: 2014-06-10 14:31 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
example shortcut assignment (8.88 KB, image/png)
2014-05-25 08:11 UTC, Michael Werner
Details
behavior with Qt patch (27.65 KB, image/png)
2014-06-06 00:20 UTC, Sebastian Kügler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Werner 2014-05-25 08:06:02 UTC
When I want to assign a new shortcut in kde5 systemsettings with Meta key. Garbaged is recognized. ctrl, shift modifiers  working fine.


Reproducible: Always

Steps to Reproduce:
1.systemsettings start shortcuts and gestures
2.Try to assign an new shortcut
3.
Actual Results:  
Garbage keys +D

Expected Results:  
Meta+D
Comment 1 Michael Werner 2014-05-25 08:11:59 UTC
Created attachment 86806 [details]
example shortcut assignment
Comment 2 David Edmundson 2014-06-03 21:00:26 UTC
Would you be able to test if this fixes it please.
https://codereview.qt-project.org/#change,86598
Comment 3 Vishesh Handa 2014-06-05 13:37:17 UTC
This is a problem in Qt, and is fixed in the patch linked above. Now we just need it to be accepted.
Comment 4 Sebastian Kügler 2014-06-06 00:17:16 UTC
The Qt patch solves the problem for me partly.

The test program now behaves as expected on my system, but I cannot assign meta as shortcut modifier. The behaviour in the shortcuts editor is now as follows:

- open shortcuts editor
- click on shortcut
- [widget now waits for input]
- press meta
- [widget assigns "Meta<GARBAGE>"]
- here the widget should still wait for input, but it assigns right away

I'll attach a screenshot showing what's going on here.
Comment 5 Sebastian Kügler 2014-06-06 00:20:15 UTC
Created attachment 87034 [details]
behavior with Qt patch

kkeysequencewidget in shortcuts editor, with Qt patch
Comment 6 Sebastian Kügler 2014-06-06 00:40:08 UTC
Alright, it seems KKeySequenceWidget needs the same kind of treatment, with a small patch, it all works as expected:

diff --git a/src/kkeysequencewidget.cpp b/src/kkeysequencewidget.cpp
index b6fcd20..fdba9b9 100644
--- a/src/kkeysequencewidget.cpp
+++ b/src/kkeysequencewidget.cpp
@@ -734,6 +734,8 @@ void KKeySequenceButton::keyPressEvent(QKeyEvent *e)
     case Qt::Key_Control:
     case Qt::Key_Alt:
     case Qt::Key_Meta:
+    case Qt::Key_Super_L:
+    case Qt::Key_Super_R:
     case Qt::Key_Menu: //unused (yes, but why?)
         d->controlModifierlessTimout();
         d->updateShortcutDisplay();


I've filed a review request here: https://git.reviewboard.kde.org/r/118581/
Comment 7 Christoph Feck 2014-06-06 12:11:02 UTC
*** Bug 334445 has been marked as a duplicate of this bug. ***
Comment 8 Sebastian Kügler 2014-06-09 22:06:32 UTC
Git commit d8e40e8579f559819a703c37cdca7849b618dc55 by Sebastian Kügler.
Committed on 06/06/2014 at 00:32.
Pushed by sebas into branch 'master'.

Consider Super_L and Super_R as modifiers

Without this patch, I can't use the meta key to assign shortcuts, as
Super_L and Super_R are not considered as modifiers, so when I press
meta (Super_L on my system), the shortcut is immediately accepted,
before I get the chance to press another key.

This patch requires the fix in
https://bugreports.qt-project.org/browse/QTBUG-38428
to be applied. With both patches, KKeySequenceWidget works for me.
REVIEW:118581

M  +2    -0    src/kkeysequencewidget.cpp

http://commits.kde.org/kxmlgui/d8e40e8579f559819a703c37cdca7849b618dc55
Comment 9 Sebastian Kügler 2014-06-10 14:31:49 UTC
Git commit 7eaa20924b99e3fa92ec3aaddef3631e7400f3e8 by Sebastian Kügler.
Committed on 09/06/2014 at 22:01.
Pushed by sebas into branch 'master'.

Consider Super_L and Super_R as modifiers

Without this patch, I can't use the meta key to assign shortcuts, as
Super_L and Super_R are not considered as modifiers, so when I press
meta (Super_L on my system), the shortcut is immediately accepted,
before I get the chance to press another key.

This patch requires the fix in
https://bugreports.qt-project.org/browse/QTBUG-38428
to be applied. With both patches, the QtQuick widgets to assign
shortcuts works for me also with the Meta key.

Suggested by David Edmundson in review request at
https://git.reviewboard.kde.org/r/118581/

If the upstream Qt fix changes, we'll have to readjust here, but at
least now we have a good chance of it working.
REVIEW:118630

M  +2    -0    src/qmlcontrols/kquickcontrols/private/keysequencehelper.cpp

http://commits.kde.org/kdeclarative/7eaa20924b99e3fa92ec3aaddef3631e7400f3e8