summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-11-03 11:44:42 +0100
committerFriedemann Kleint <Friedemann.Kleint@digia.com>2014-11-03 20:42:36 +0100
commitcca4eb45c5e1a70d2c39cad2d77abf0b986bc087 (patch)
treec0620277faf3cd8bb3f658e5e02134fb45e425cb
parenteab4bd5cee2faa78962184f7c04b03ec3383e3c7 (diff)
Windows: Ignore key Shift+F10 unless a shortcut is registered for it.
This key combination should open the context menu. Task-number: QTBUG-40085 Change-Id: I7cfc89f766b3734b9fb9d3c9135b4896ffbadb5b Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index 990dbaeba2..ff9ad1874a 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -39,6 +39,7 @@
#include <QtGui/QWindow>
#include <qpa/qwindowsysteminterface.h>
+#include <private/qguiapplication_p.h>
#include <QtGui/QKeyEvent>
QT_BEGIN_NAMESPACE
@@ -1104,9 +1105,17 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
else {
const QString text = uch.isNull() ? QString() : QString(uch);
const char a = uch.row() ? 0 : uch.cell();
+ const Qt::KeyboardModifiers modifiers(state);
+#ifndef QT_NO_SHORTCUT
+ // Is Qt interested in the context menu key?
+ if (modifiers == Qt::SHIFT && code == Qt::Key_F10
+ && !QGuiApplicationPrivate::instance()->shortcutMap.hasShortcutForKeySequence(QKeySequence(Qt::SHIFT + Qt::Key_F10))) {
+ return false;
+ }
+#endif // !QT_NO_SHORTCUT
key_recorder.storeKey(msg.wParam, a, state, text);
QWindowSystemInterface::handleExtendedKeyEvent(receiver, QEvent::KeyPress, code,
- Qt::KeyboardModifier(state), scancode, msg.wParam, nModifiers, text, false);
+ modifiers, scancode, msg.wParam, nModifiers, text, false);
result =true;
bool store = true;
#ifndef Q_OS_WINCE