Changeset 136 for trunk/src/gui/kernel/qapplication_pm.cpp
- Timestamp:
- Aug 28, 2009, 7:46:09 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/kernel/qapplication_pm.cpp
r134 r136 508 508 #if defined(QT_DEBUGMSGFLOW) 509 509 { 510 Q Stringstr = qStrQMSG(qmsg);510 QDbgStr str = qStrQMSG(qmsg); 511 511 if (!str.isEmpty()) 512 qDebug() << "*** [W]" << str .toUtf8().constData();512 qDebug() << "*** [W]" << str; 513 513 } 514 514 #endif … … 602 602 } else { 603 603 switch(msg) { 604 605 case WM_CHAR: { // keyboard event 606 QWidget *g = QWidget::keyboardGrabber(); 607 if (g) 608 widget = (QETWidget*)g; 609 else if (QApplication::activePopupWidget()) 610 widget = (QETWidget*)QApplication::activePopupWidget()->focusWidget() 611 ? (QETWidget*)QApplication::activePopupWidget()->focusWidget() 612 : (QETWidget*)QApplication::activePopupWidget(); 613 else if (qApp->focusWidget()) 614 widget = (QETWidget*)QApplication::focusWidget(); 615 else if (widget->internalWinId() == WinQueryFocus(HWND_DESKTOP)) { 616 // We faked the message to go to exactly that widget. 617 widget = (QETWidget*)widget->window(); 618 } 619 if (widget->isEnabled()) { 620 bool result = 621 #if !defined (QT_NO_SESSIONMANAGER) 622 sm_blockUserInput ? true : 623 #endif 624 qt_keymapper_private()->translateKeyEvent(widget, qmsg, g != 0); 625 if (result) 626 return (MRESULT)TRUE; 627 } 628 break; 629 } 604 630 605 631 case WM_PAINT: { // paint event … … 811 837 #if defined(QT_DEBUGMSGFLOW) 812 838 { 813 Q Stringstr = qStrQMSG(qmsg);839 QDbgStr str = qStrQMSG(qmsg); 814 840 if (!str.isEmpty()) 815 qDebug() << "*** [F]" << str .toUtf8().constData();841 qDebug() << "*** [F]" << str; 816 842 } 817 843 #endif … … 1033 1059 *****************************************************************************/ 1034 1060 1035 // State holder for LWIN/RWIN and ALTGr keys1036 // (ALTGr is also necessary since OS/2 doesn't report ALTGr as KC_ALT)1037 static int qt_extraKeyState = 0;1038 1039 1061 static int mouseButtonState() 1040 1062 { … … 1122 1144 bst |= Qt::ControlModifier; 1123 1145 } 1124 if ( (qt_extraKeyState & Qt::AltModifier))1146 if (qt_keymapper_private()->extraKeyState & Qt::AltModifier) 1125 1147 bst |= Qt::AltModifier; 1126 if (qt_ extraKeyState & Qt::MetaModifier)1148 if (qt_keymapper_private()->extraKeyState & Qt::MetaModifier) 1127 1149 bst |= Qt::MetaModifier; 1128 1150 … … 1547 1569 state |= Qt::ShiftModifier; 1548 1570 if (WinGetKeyState(HWND_DESKTOP, VK_ALT) & 0x8000 || 1549 (qt_ extraKeyState & Qt::AltModifier))1571 (qt_keymapper_private()->extraKeyState & Qt::AltModifier)) 1550 1572 state |= Qt::AltModifier; 1551 1573 if (WinGetKeyState(HWND_DESKTOP, VK_CTRL) & 0x8000) 1552 1574 state |= Qt::ControlModifier; 1553 if (qt_ extraKeyState & Qt::MetaModifier)1575 if (qt_keymapper_private()->extraKeyState & Qt::MetaModifier) 1554 1576 state |= Qt::MetaModifier; 1555 1577 … … 1909 1931 switch (qmsg.msg) { 1910 1932 1933 myCaseBegin(WM_CHAR) 1934 USHORT fl = SHORT1FROMMP(qmsg.mp1); 1935 UCHAR repeat = CHAR3FROMMP(qmsg.mp1); 1936 UCHAR scan = CHAR4FROMMP(qmsg.mp1); 1937 USHORT ch = SHORT1FROMMP(qmsg.mp2); 1938 USHORT vk = SHORT2FROMMP(qmsg.mp2); 1939 str += QString(). 1940 sprintf(" rep %02d scan %02X ch %04X (%ls) vk %04X", 1941 repeat, scan, ch, (ch > 32 && ch < 254) ? 1942 QString::fromLocal8Bit((char *)&ch, 1).utf16() : 1943 QString(QChar(' ')).utf16(), vk); 1944 QString flstr; 1945 myDefFlagEx(fl, KC_CHAR, flstr, "CHAR"); 1946 myDefFlagEx(fl, KC_VIRTUALKEY, flstr, "VIRT"); 1947 myDefFlagEx(fl, KC_SCANCODE, flstr, "SCAN"); 1948 myDefFlagEx(fl, KC_SHIFT, flstr, "SHIFT"); 1949 myDefFlagEx(fl, KC_CTRL, flstr, "CTRL"); 1950 myDefFlagEx(fl, KC_ALT, flstr, "ALT"); 1951 myDefFlagEx(fl, KC_KEYUP, flstr, "UP"); 1952 myDefFlagEx(fl, KC_PREVDOWN, flstr, "PREVDWN"); 1953 myDefFlagEx(fl, KC_LONEKEY, flstr, "LONE"); 1954 myDefFlagEx(fl, KC_DEADKEY, flstr, "DEAD"); 1955 myDefFlagEx(fl, KC_COMPOSITE, flstr, "COMP"); 1956 myDefFlagEx(fl, KC_INVALIDCOMP, flstr, "INVCMP"); 1957 myDefFlagEx(fl, KC_TOGGLE, flstr, "TGGL"); 1958 myDefFlagEx(fl, KC_INVALIDCHAR, flstr, "INVCHR"); 1959 str += QString().sprintf(" KC(%04X,", fl) + flstr + QCStr(")"); 1960 break; 1961 myCaseEnd() 1962 1911 1963 myCaseBegin(WM_PAINT) 1912 1964 break;
Note:
See TracChangeset
for help on using the changeset viewer.