summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qkeymapper_mac.cpp
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2010-06-25 17:35:55 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2010-06-25 17:35:55 (GMT)
commit8576e0f3652a8de05a5e59488b2611833944e6d6 (patch)
tree31e2b9774dd5b8955094e3085b8e5f8a67a73526 /src/gui/kernel/qkeymapper_mac.cpp
parentaaa7dd6200ce272ea1e3dd78148844200ac698a7 (diff)
parent842ccf428d4cbed3c4ce1e0c894fbebcfd59ce0e (diff)
downloadQt-8576e0f3652a8de05a5e59488b2611833944e6d6.zip
Qt-8576e0f3652a8de05a5e59488b2611833944e6d6.tar.gz
Qt-8576e0f3652a8de05a5e59488b2611833944e6d6.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'src/gui/kernel/qkeymapper_mac.cpp')
-rw-r--r--src/gui/kernel/qkeymapper_mac.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gui/kernel/qkeymapper_mac.cpp b/src/gui/kernel/qkeymapper_mac.cpp
index 873b8f9..3dc6afc 100644
--- a/src/gui/kernel/qkeymapper_mac.cpp
+++ b/src/gui/kernel/qkeymapper_mac.cpp
@@ -866,14 +866,27 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, EventHandlerCallRef e
UInt32 macModifiers = 0;
GetEventParameter(event, kEventParamKeyModifiers, typeUInt32, 0,
sizeof(macModifiers), 0, &macModifiers);
+#ifdef QT_MAC_USE_COCOA
+ // The unicode characters in the range 0xF700-0xF747 are reserved
+ // by Mac OS X for transient use as keyboard function keys. We
+ // wont send 'text' for such key events. This is done to match
+ // behavior on other platforms.
+ unsigned int *unicodeKey = (unsigned int*)info;
+ if (*unicodeKey >= 0xf700 && *unicodeKey <= 0xf747)
+ text = QString();
+ bool isAccepted;
+#endif
handled_event = QKeyMapper::sendKeyEvent(widget, grab,
(ekind == kEventRawKeyUp) ? QEvent::KeyRelease : QEvent::KeyPress,
qtKey, modifiers, text, ekind == kEventRawKeyRepeat, 0,
macScanCode, macVirtualKey, macModifiers
#ifdef QT_MAC_USE_COCOA
- ,static_cast<bool *>(info)
+ ,&isAccepted
#endif
);
+#ifdef QT_MAC_USE_COCOA
+ *unicodeKey = (unsigned int)isAccepted;
+#endif
}
return handled_event;
}