From cca4eb45c5e1a70d2c39cad2d77abf0b986bc087 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 3 Nov 2014 11:44:42 +0100 Subject: 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 Reviewed-by: Frederik Gladhorn --- src/plugins/platforms/windows/qwindowskeymapper.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms') 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 #include +#include #include 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 -- cgit v1.2.3