Translate Super/Hyper keys to MetaModifier

This is how it was done in Qt4. If users are interested
in an actual X11 keysym they can use QKeyEvent::nativeVirtualKey().

Change-Id: I710664e48c5db1633a357aa0a5d238f3453103ab
Task-number: QTBUG-38428
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Sebastian Kügler <sebas@kde.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
This commit is contained in:
Gatis Paeglis 2014-06-17 11:41:23 +02:00
parent 1f3d9b12ab
commit 51d6df1d18

View File

@ -929,6 +929,15 @@ int QXcbKeyboard::keysymToQtKey(xcb_keysym_t key) const
i += 2;
}
if (rmod_masks.meta) {
// translate Super/Hyper keys to Meta if we're using them as the MetaModifier
if (rmod_masks.meta == rmod_masks.super && (code == Qt::Key_Super_L || code == Qt::Key_Super_R)) {
code = Qt::Key_Meta;
} else if (rmod_masks.meta == rmod_masks.hyper && (code == Qt::Key_Hyper_L || code == Qt::Key_Hyper_R)) {
code = Qt::Key_Meta;
}
}
return code;
}