summaryrefslogtreecommitdiffstats
path: root/tests/auto/macnativeevents/qnativeevents_mac.cpp
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-05-07 08:44:34 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-05-20 13:22:48 (GMT)
commit8b0c6e6d68053b62b3b38e9a2cf24e39b6df9086 (patch)
treeedb63c90bf73a120121c1fb3380d234e163ec9a3 /tests/auto/macnativeevents/qnativeevents_mac.cpp
parent0847b9b50987f2e11e3193e7eed4012e4240a492 (diff)
downloadQt-8b0c6e6d68053b62b3b38e9a2cf24e39b6df9086.zip
Qt-8b0c6e6d68053b62b3b38e9a2cf24e39b6df9086.tar.gz
Qt-8b0c6e6d68053b62b3b38e9a2cf24e39b6df9086.tar.bz2
Autotest, Mac: added more native key event testing
Added a couple of more tests that checks, among others, modifier flags. It turns out that there are some issues related to this: 1. When releasing a key while holding the command modifier, we do not key at key up event from cocoa. 2. The AA_MacDontSwapCtrlAndMeta attribute turns out to be half-way implemented. This test will not fail on any of this issues.
Diffstat (limited to 'tests/auto/macnativeevents/qnativeevents_mac.cpp')
-rw-r--r--tests/auto/macnativeevents/qnativeevents_mac.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/macnativeevents/qnativeevents_mac.cpp b/tests/auto/macnativeevents/qnativeevents_mac.cpp
index 6c04bf3..cc12cc9 100644
--- a/tests/auto/macnativeevents/qnativeevents_mac.cpp
+++ b/tests/auto/macnativeevents/qnativeevents_mac.cpp
@@ -54,11 +54,11 @@ static Qt::KeyboardModifiers getModifiersFromQuartzEvent(CGEventRef inEvent)
if (flags & kCGEventFlagMaskShift || flags & kCGEventFlagMaskAlphaShift)
m |= Qt::ShiftModifier;
if (flags & kCGEventFlagMaskControl)
- m |= Qt::MetaModifier;
+ m |= Qt::ControlModifier;
if (flags & kCGEventFlagMaskAlternate)
m |= Qt::AltModifier;
if (flags & kCGEventFlagMaskCommand)
- m |= Qt::ControlModifier;
+ m |= Qt::MetaModifier;
return m;
}
@@ -67,11 +67,11 @@ static void setModifiersFromQNativeEvent(CGEventRef inEvent, const QNativeEvent
CGEventFlags flags = 0;
if (event.modifiers.testFlag(Qt::ShiftModifier))
flags |= kCGEventFlagMaskShift;
- if (event.modifiers.testFlag(Qt::MetaModifier))
+ if (event.modifiers.testFlag(Qt::ControlModifier))
flags |= kCGEventFlagMaskControl;
if (event.modifiers.testFlag(Qt::AltModifier))
flags |= kCGEventFlagMaskAlternate;
- if (event.modifiers.testFlag(Qt::ControlModifier))
+ if (event.modifiers.testFlag(Qt::MetaModifier))
flags |= kCGEventFlagMaskCommand;
CGEventSetFlags(inEvent, flags);
}