diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2009-04-17 10:08:13 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-04-17 10:08:13 (GMT) |
commit | 865a87c9069f5f273bab130b0e9c57535f52ec64 (patch) | |
tree | f0d25536b75ff5055234f0d4ccc0314c9aae1d15 | |
parent | 8aa8997f18afb85cb17f5b2a875a004302df4c72 (diff) | |
parent | 5d39d424a92d89243207d8370d0fa1c6c8061668 (diff) | |
download | Qt-865a87c9069f5f273bab130b0e9c57535f52ec64.zip Qt-865a87c9069f5f273bab130b0e9c57535f52ec64.tar.gz Qt-865a87c9069f5f273bab130b0e9c57535f52ec64.tar.bz2 |
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into 4.5
-rw-r--r-- | src/gui/kernel/qt_cocoa_helpers_mac.mm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index 9c381b4..52e76d8 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -555,12 +555,15 @@ bool qt_dispatchKeyEventWithCocoa(void * /*NSEvent * */ keyEvent, QWidget *widge int keyLength = [keyChars length]; if (keyLength == 0) return false; // Dead Key, nothing to do! + bool ignoreText = false; Qt::Key qtKey = Qt::Key_unknown; if (keyLength == 1) { QChar ch([keyChars characterAtIndex:0]); if (ch.isLower()) ch = ch.toUpper(); qtKey = cocoaKey2QtKey(ch); + // Do not set the text for Function-Key Unicodes characters (0xF700–0xF8FF). + ignoreText = (ch.unicode() >= 0xF700 && ch.unicode() <= 0xF8FF); } Qt::KeyboardModifiers keyMods = qt_cocoaModifiers2QtModifiers([event modifierFlags]); QString text; @@ -568,7 +571,7 @@ bool qt_dispatchKeyEventWithCocoa(void * /*NSEvent * */ keyEvent, QWidget *widge // To quote from the Carbon port: This is actually wrong--but it is the best that // can be done for now because of the Control/Meta mapping issues // (we always get text on the Mac) - if (!(keyMods & (Qt::ControlModifier | Qt::MetaModifier))) + if (!ignoreText && !(keyMods & (Qt::ControlModifier | Qt::MetaModifier))) text = QCFString::toQString(reinterpret_cast<CFStringRef>(keyChars)); UInt32 macScanCode = 1; |