- Timestamp:
- Oct 25, 2001, 5:35:53 PM (24 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/oslibmsg.cpp
r6972 r7205 1 /* $Id: oslibmsg.cpp,v 1.4 5 2001-10-09 05:18:02phaller Exp $ */1 /* $Id: oslibmsg.cpp,v 1.46 2001-10-25 15:35:53 phaller Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 368 368 return FALSE; 369 369 } 370 370 371 // @@@PH 372 // warning - OS2ToWinMsgTranslate might insert additional messages 373 // into the queue 371 374 if(OS2ToWinMsgTranslate((PVOID)teb, &os2msg, pMsg, isUnicode, (fRemove & PM_REMOVE_W) ? MSG_REMOVE : MSG_NOREMOVE) == FALSE) 372 375 { -
trunk/src/user32/oslibmsgtranslate.cpp
r7201 r7205 1 /* $Id: oslibmsgtranslate.cpp,v 1.6 7 2001-10-25 13:16:57phaller Exp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.68 2001-10-25 15:35:53 phaller Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 35 35 #include <pmkbdhk.h> 36 36 #include <pmscan.h> 37 #include <winscan.h> 37 38 38 39 #define DBG_LOCALLOG DBG_oslibmsgtranslate … … 164 165 static MSG doubleClickMsg = {0}; 165 166 167 168 //****************************************************************************** 169 //****************************************************************************** 170 BOOL setThreadQueueExtraCharMessage(TEB* teb, MSG* pExtraMsg) 171 { 172 // check if the single slot is occupied already 173 if (teb->o.odin.fTranslated == TRUE) 174 // there's still an already translated message to be processed 175 return FALSE; 176 177 teb->o.odin.fTranslated = TRUE; 178 memcpy(&teb->o.odin.msgWCHAR, pExtraMsg, sizeof(MSG)); 179 return TRUE; 180 } 181 166 182 //****************************************************************************** 167 183 //****************************************************************************** … … 652 668 dprintf(("PM: WM_CHAR_SPECIAL\n")); 653 669 654 // AltGr is a very, very strange key! 655 UCHAR ucPMScanCode = CHAR4FROMMP(os2Msg->mp1); 656 switch (ucPMScanCode) 657 { 658 case PMSCAN_ESC: 659 // Note: ESC generates a WM_CHAR under Windows, not under PM 660 // so we've got to post it to ourself here! 661 // WM_CHAR(0x0000001bh, 00010001h) 662 // @@@PH 663 break; 664 665 case PMSCAN_PRINT: 666 // Note: PRINT generates a WM_KEYUP under Windows 667 // also only call the standard kbd hook for the WM_KEYUP msg, 668 // the low-level hook is called twice 669 // WM_CHAR(0x0000002ch, c1370001h) 670 // @@@PH 671 break; 672 673 case PMSCAN_ALTRIGHT: 674 { 675 ULONG flags = SHORT1FROMMP(os2Msg->mp1); 676 677 // we need very special treatment here for the 678 // poor, crippled AltGr key 679 680 if (flags & KC_KEYUP) 681 { 682 // key up 683 // 1 - generate a virtual LCONTROL-keypress 684 // 2 - send LMENU-keypress (NT emulates ALtGr w/ Ctrl-Alt!) 685 } 686 else 687 { 688 // key down: 689 // 1 - generate a virtual LCONTROL-keypress 690 // 2 - send LMENU-keypress (NT emulates ALtGr w/ Ctrl-AltGr!) 691 } 692 } 693 } /* switch */ 694 } /* case */ 695 // NO BREAK! FALLTHRU CASE! 670 // NO BREAK! FALLTHRU CASE! 671 } 696 672 697 673 case WM_CHAR: … … 824 800 winMsg->lParam |= 1 << 29; 825 801 } 802 } 803 804 // ------------------------------------------------ 805 // check if additional messages have to be recorded 806 // ------------------------------------------------ 807 { 808 MSG extramsg; 809 extramsg.hwnd = winMsg->hwnd; 810 extramsg.time = winMsg->time; 811 extramsg.pt = winMsg->pt; 812 813 switch (scanCode) 814 { 815 case PMSCAN_ESC: 816 { 817 // Note: ESC generates a WM_CHAR for WINWM_KEYDOWN 818 // under Windows, not under PM 819 // so we've got to post it to ourself here! 820 // WM_CHAR(0x0000001bh, 00010001h) 821 if (winMsg->message == WINWM_KEYDOWN) 822 { 823 extramsg.message = WINWM_CHAR; 824 extramsg.wParam = VK_ESCAPE_W; 825 extramsg.lParam = winMsg->lParam; 826 setThreadQueueExtraCharMessage(teb, &extramsg); 827 } 828 } 829 break; 830 831 #if 0 832 case PMSCAN_PRINT: 833 // Note: PRINT generates a WM_KEYUP under Windows 834 // also only call the standard kbd hook for the WM_KEYUP msg, 835 // the low-level hook is called twice 836 // mb->putWinMsg(hwndWin32, WM_CHAR, VK_PRINT_W, ... ) 837 // WM_CHAR(0x0000002ch, c1370001h) 838 extramsg.message = WINWM_KEYUP; 839 extramsg.wParam = VK_PRINT_W; 840 extramsg.lParam = winMsg->lParam; 841 setThreadQueueExtraCharMessage(teb, &extramsg); 842 break; 843 #endif 844 845 case PMSCAN_ALTRIGHT: 846 { 847 // we need very special treatment here for the 848 // poor, crippled AltGr key 849 if (keyWasPressed) 850 { 851 // 1 - generate a virtual LCONTROL-keypress 852 // 2 - send LMENU-keypress (NT emulates ALtGr w/ Ctrl-AltGr!) 853 // 0xfe000000: mask out extended-key, scancode, repeatcount 854 extramsg.message = WINWM_KEYDOWN; 855 extramsg.wParam = VK_RMENU_W; 856 extramsg.lParam = (winMsg->lParam & 0xfe000000) 857 | repeatCount 858 | (WINSCAN_ALTRIGHT << 24); 859 winMsg->message = WINWM_KEYDOWN; 860 winMsg->wParam = VK_LCONTROL_W; 861 winMsg->lParam = (winMsg->lParam & 0xfe000000) 862 | repeatCount 863 | (WINSCAN_CTRLLEFT << 24); 864 } 865 else 866 { 867 // key up 868 // 1 - generate a virtual LCONTROL-keypress 869 // 2 - send LMENU-keypress (NT emulates ALtGr w/ Ctrl-Alt!) 870 extramsg.message = WINWM_KEYDOWN; 871 extramsg.wParam = VK_RMENU_W; 872 extramsg.lParam = (winMsg->lParam & 0xfe000000) 873 | repeatCount 874 | (WINSCAN_ALTRIGHT << 24); 875 winMsg->message = WINWM_SYSKEYUP; 876 winMsg->wParam = VK_LCONTROL_W; 877 winMsg->lParam = (winMsg->lParam & 0xfe000000) 878 | repeatCount 879 | (WINSCAN_CTRLLEFT << 24); 880 } 881 882 setThreadQueueExtraCharMessage(teb, &extramsg); 883 } 884 } /* switch */ 826 885 } 827 886 … … 1026 1085 if(fl & KC_KEYUP) 1027 1086 extramsg.lParam |= (1<<31); 1028 1029 teb->o.odin.fTranslated = TRUE;1030 memcpy(&teb->o.odin.msgWCHAR, &extramsg, sizeof(MSG));1087 1088 // insert message into the queue 1089 setThreadQueueExtraCharMessage(teb, &extramsg); 1031 1090 return TRUE; 1032 1091 }
Note:
See TracChangeset
for help on using the changeset viewer.