Changeset 561 for trunk/src/gui/kernel/qkeymapper_mac.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/kernel/qkeymapper_mac.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 49 49 #include <private/qkeymapper_p.h> 50 50 #include <private/qapplication_p.h> 51 #include <private/qmacinputcontext_p.h> 51 52 52 53 QT_BEGIN_NAMESPACE … … 161 162 } 162 163 } 164 if (qApp->testAttribute(Qt::AA_MacDontSwapCtrlAndMeta)) { 165 Qt::KeyboardModifiers oldModifiers = ret; 166 ret &= ~(Qt::MetaModifier | Qt::ControlModifier); 167 if (oldModifiers & Qt::ControlModifier) 168 ret |= Qt::MetaModifier; 169 if (oldModifiers & Qt::MetaModifier) 170 ret |= Qt::ControlModifier; 171 } 163 172 return ret; 164 173 } … … 176 185 ret |= qt_mac_modifier_symbols[i].mac_code; 177 186 } 187 } 188 189 if (qApp->testAttribute(Qt::AA_MacDontSwapCtrlAndMeta)) { 190 int oldModifiers = ret; 191 ret &= ~(controlKeyBit | cmdKeyBit); 192 if (oldModifiers & controlKeyBit) 193 ret |= cmdKeyBit; 194 if (oldModifiers & cmdKeyBit) 195 ret |= controlKeyBit; 178 196 } 179 197 return ret; … … 481 499 if (outHandled) { 482 500 qt_mac_eat_unicode_key = false; 483 CallNextEventHandler(er, keyEvent); 501 if (er) 502 CallNextEventHandler(er, keyEvent); 484 503 *outHandled = qt_mac_eat_unicode_key; 485 504 } … … 545 564 QKeyMapperPrivate::~QKeyMapperPrivate() 546 565 { 547 clearMappings();566 deleteLayouts(); 548 567 } 549 568 … … 640 659 641 660 void 642 QKeyMapperPrivate:: clearMappings()661 QKeyMapperPrivate::deleteLayouts() 643 662 { 644 663 keyboard_mode = NullMode; … … 649 668 } 650 669 } 670 } 671 672 void 673 QKeyMapperPrivate::clearMappings() 674 { 675 deleteLayouts(); 651 676 updateKeyboard(); 652 677 } … … 693 718 } 694 719 695 if (qApp->inputContext() && qApp->inputContext()->isComposing()) 720 if (qApp->inputContext() && qApp->inputContext()->isComposing()) { 721 if (ekind == kEventRawKeyDown) { 722 QMacInputContext *context = qobject_cast<QMacInputContext*>(qApp->inputContext()); 723 if (context) 724 context->setLastKeydownEvent(event); 725 } 696 726 return false; 727 } 697 728 //get modifiers 698 729 Qt::KeyboardModifiers modifiers; … … 705 736 /* This is actually wrong - but unfortunatly it is the best that can be 706 737 done for now because of the Control/Meta mapping problems */ 707 if (modifiers & (Qt::ControlModifier | Qt::MetaModifier)) 738 if (modifiers & (Qt::ControlModifier | Qt::MetaModifier) 739 && !qApp->testAttribute(Qt::AA_MacDontSwapCtrlAndMeta)) { 708 740 text = QString(); 741 } 709 742 710 743 … … 722 755 //with a QKeyEvent. 723 756 qt_mac_eat_unicode_key = false; 724 CallNextEventHandler(er, event); 757 if (er) 758 CallNextEventHandler(er, event); 725 759 extern bool qt_mac_menubar_is_open(); 726 760 if (qt_mac_eat_unicode_key || qt_mac_menubar_is_open()) {
Note:
See TracChangeset
for help on using the changeset viewer.