Commit 4306fb8f authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[KeySequenceHelper] Work around Meta modifier behavior

When I press my Meta key, I get a Key_Super_L *without* a Meta key confusing the rest of the modifier handling in this class.
To work around this, explicitly set MetaModifier when the key is pressed and remove it

Differential Revision: https://phabricator.kde.org/D26016
parent 6c5619ff
......@@ -423,6 +423,11 @@ void KeySequenceHelper::keyPressed(int key, int modifiers)
return d->cancelRecording();
}
// Qt doesn't properly recognize Super_L/Super_R as MetaModifier
if (key == Qt::Key_Super_L || key == Qt::Key_Super_R) {
modifiers |= Qt::MetaModifier;
}
//don't have the return or space key appear as first key of the sequence when they
//were pressed to start editing - catch and them and imitate their effect
if (!d->isRecording && ((key == Qt::Key_Return || key == Qt::Key_Space))) {
......@@ -492,6 +497,11 @@ void KeySequenceHelper::keyReleased(int key, int modifiers)
return;
}
// Qt doesn't properly recognize Super_L/Super_R as MetaModifier
if (key == Qt::Key_Super_L || key == Qt::Key_Super_R) {
modifiers &= ~Qt::MetaModifier;
}
//if a modifier that belongs to the shortcut was released...
if ((modifiers & d->modifierKeys) < d->modifierKeys) {
d->modifierKeys = modifiers;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment