summaryrefslogtreecommitdiff
path: root/Source/WebCore/page/qt/EventHandlerQt.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-01-13 21:26:34 +0100
committerLiang Qi <liang.qi@qt.io>2018-01-13 21:26:34 +0100
commitbeaeeb99881184fd368c121fcbb1a31c78b794a3 (patch)
tree0e078499d8fe3e8627e3612537e61f2dd1029625 /Source/WebCore/page/qt/EventHandlerQt.cpp
parentf7697030f444b5e16331c6d0a99712736b9ff026 (diff)
parent79143ccfc158ec4fffc49eee600d600edb342b16 (diff)
downloadqtwebkit-beaeeb99881184fd368c121fcbb1a31c78b794a3.tar.gz
Merge remote-tracking branch 'origin/5.212' into dev
Change-Id: I9e64176fe95183acf5e093aa081b0a498795bdb2
Diffstat (limited to 'Source/WebCore/page/qt/EventHandlerQt.cpp')
-rw-r--r--Source/WebCore/page/qt/EventHandlerQt.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/WebCore/page/qt/EventHandlerQt.cpp b/Source/WebCore/page/qt/EventHandlerQt.cpp
index 240ea75eb..b717b1f54 100644
--- a/Source/WebCore/page/qt/EventHandlerQt.cpp
+++ b/Source/WebCore/page/qt/EventHandlerQt.cpp
@@ -49,6 +49,7 @@
#include "PlatformWheelEvent.h"
#include "RenderWidget.h"
#include "Scrollbar.h"
+#include <QCoreApplication>
namespace WebCore {
@@ -123,7 +124,14 @@ bool EventHandler::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults&
unsigned EventHandler::accessKeyModifiers()
{
#if OS(DARWIN)
- return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
+ // On macOS, the ControlModifier value corresponds
+ // to the Command keys on the keyboard,
+ // and the MetaModifier value corresponds to the Control keys.
+ // See http://doc.qt.io/qt-5/qt.html#KeyboardModifier-enum
+ if (UNLIKELY(QCoreApplication::testAttribute(Qt::AA_MacDontSwapCtrlAndMeta)))
+ return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
+ else
+ return PlatformEvent::MetaKey | PlatformEvent::AltKey;
#else
return PlatformEvent::AltKey;
#endif