From 51d6df1d18322c630f79567ed22de3718436d78d Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Tue, 17 Jun 2014 11:41:23 +0200 Subject: [PATCH 1/1] Translate Super/Hyper keys to MetaModifier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Lars Knoll Reviewed-by: Sebastian Kügler Reviewed-by: Shawn Rutledge --- src/plugins/platforms/xcb/qxcbkeyboard.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp index 69601f4..4c84b19 100644 --- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp +++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp @@ -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; } -- 1.9.3