- Timestamp:
- Dec 11, 2001, 6:34:53 PM (24 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/HOOK.CPP
r7306 r7612 1 /* $Id: HOOK.CPP,v 1.3 3 2001-11-09 01:26:14 phallerExp $ */1 /* $Id: HOOK.CPP,v 1.34 2001-12-11 17:34:52 sandervl Exp $ */ 2 2 3 3 /* … … 780 780 { 781 781 // call the low level hook first 782 ProcessKbdHookLL(msg, remove, FALSE);783 782 if(ProcessKbdHookLL(msg, remove, FALSE) == TRUE) return TRUE; 783 784 784 // ALT-Key comes in with different scan code (0xa4 == VK_LMENU_W), 785 785 // then gets translated to 0x12 … … 872 872 kbhs.dwExtraInfo = 0; // @@@PH not supported? 873 873 874 dprintf(("WH_KEYBOARD_LL: kbhs.vkCode %x kbhs.scanCode %x kbhs.flags %x", kbhs.vkCode, kbhs.scanCode, kbhs.flags)); 875 874 876 return (HOOK_CallHooksA(WH_KEYBOARD_LL, 875 877 flagRemove ? HC_ACTION : HC_NOREMOVE, -
trunk/src/user32/oslibmsg.cpp
r7370 r7612 1 /* $Id: oslibmsg.cpp,v 1.5 0 2001-11-16 17:47:05 phallerExp $ */1 /* $Id: oslibmsg.cpp,v 1.51 2001-12-11 17:34:53 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 209 209 //****************************************************************************** 210 210 211 #ifdef ALTGR_HACK 211 212 static void i_MostUglyAltGrHack(LPMSG pMsg) 212 213 { … … 224 225 } 225 226 } 226 227 #else 228 #define i_MostUglyAltGrHack(a) 229 #endif 227 230 228 231 BOOL OSLibWinGetMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, … … 251 254 } 252 255 253 if(teb->o.odin.fTranslated && (!hwnd || hwnd == teb->o.odin.msgWCHAR.hwnd)) { 256 if(teb->o.odin.fTranslated && (!hwnd || hwnd == teb->o.odin.msgWCHAR.hwnd)) 257 { 258 dprintf(("Return queued WM_CHAR message hwnd=%x msg=%d wParam=%x lParam=%x", teb->o.odin.msgWCHAR.hwnd, teb->o.odin.msgWCHAR.message, teb->o.odin.msgWCHAR.wParam, teb->o.odin.msgWCHAR.lParam)); 254 259 if(uMsgFilterMin) { 255 260 if(teb->o.odin.msgWCHAR.message < uMsgFilterMin) … … 281 286 break; 282 287 } 283 288 284 289 i_MostUglyAltGrHack(pMsg); 285 290 286 291 return (pMsg->message != WINWM_QUIT); 287 292 } … … 385 390 } 386 391 387 if(teb->o.odin.fTranslated && (!hwnd || hwnd == teb->o.odin.msgWCHAR.hwnd)) { 392 if(teb->o.odin.fTranslated && (!hwnd || hwnd == teb->o.odin.msgWCHAR.hwnd)) 393 { 394 dprintf(("Return queued WM_CHAR message hwnd=%x msg=%d wParam=%x lParam=%x", teb->o.odin.msgWCHAR.hwnd, teb->o.odin.msgWCHAR.message, teb->o.odin.msgWCHAR.wParam, teb->o.odin.msgWCHAR.lParam)); 388 395 if(uMsgFilterMin) { 389 396 if(teb->o.odin.msgWCHAR.message < uMsgFilterMin) -
trunk/src/user32/oslibmsgtranslate.cpp
r7370 r7612 1 /* $Id: oslibmsgtranslate.cpp,v 1.7 7 2001-11-16 17:47:04 phallerExp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.78 2001-12-11 17:34:53 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 614 614 // winMsg->wParam = pmscan2winkey[scanCode][0]; 615 615 // wWinScan = pmscan2winkey[scanCode][1]; 616 616 617 617 { 618 618 BOOL fWinExtended; … … 632 632 // Set the extended bit when appropriate 633 633 if (fWinExtended) 634 winMsg->lParam = winMsg->lParam | (1<<24);634 winMsg->lParam = winMsg->lParam | WIN_KEY_EXTENDED; 635 635 } 636 636 … … 640 640 winMsg->wParam = virtualKey + 0x30; 641 641 642 643 #define WIN_KEY_EXTENDED 0x01000000 644 #define WIN_KEY_DONTCARE 0x02000000 645 #define WIN_KEY_ALTHELD 0x20000000 646 #define WIN_KEY_PREVSTATE 0x40000000 647 642 643 #ifdef ALTGR_HACK 644 648 645 if (usPMScanCode == PMSCAN_ALTRIGHT) 649 646 { … … 661 658 { 662 659 winMsg->message = WINWM_SYSKEYUP; 663 winMsg->lParam |= 1 << 29;// bit 29, alt was pressed664 winMsg->lParam |= 1 << 30;// bit 30, previous state, always 1 for a WM_KEYUP message660 winMsg->lParam |= WIN_KEY_ALTHELD; // bit 29, alt was pressed 661 winMsg->lParam |= WIN_KEY_PREVSTATE; // bit 30, previous state, always 1 for a WM_KEYUP message 665 662 winMsg->lParam |= 1 << 31; // bit 31, transition state, always 1 for WM_KEYUP 666 663 … … 675 672 winMsg->lParam |= WIN_KEY_ALTHELD; 676 673 if (keyWasPressed) 677 winMsg->lParam |= 1 << 30;// bit 30, previous state, 1 means key was pressed674 winMsg->lParam |= WIN_KEY_PREVSTATE; // bit 30, previous state, 1 means key was pressed 678 675 winMsg->message = WINWM_KEYDOWN; 679 676 … … 689 686 // KeySetOverlayKeyState(VK_RMENU_W, KEYOVERLAYSTATE_DOWN); 690 687 } 691 692 break; 693 } 694 688 } 689 #endif 695 690 696 691 if (!(flags & KC_ALT)) … … 719 714 } 720 715 721 winMsg->lParam |= 1 << 30;// bit 30, previous state, always 1 for a WM_KEYUP message716 winMsg->lParam |= WIN_KEY_PREVSTATE; // bit 30, previous state, always 1 for a WM_KEYUP message 722 717 winMsg->lParam |= 1 << 31; // bit 31, transition state, always 1 for WM_KEYUP 723 718 } … … 727 722 winMsg->message = WINWM_KEYDOWN; 728 723 if (keyWasPressed) 729 winMsg->lParam |= 1 << 30;// bit 30, previous state, 1 means key was pressed724 winMsg->lParam |= WIN_KEY_PREVSTATE; // bit 30, previous state, 1 means key was pressed 730 725 } 731 726 } … … 739 734 // send WM_SYSKEYUP message 740 735 winMsg->message = WINWM_SYSKEYUP; 741 winMsg->lParam |= 1 << 30;// bit 30, previous state, always 1 for a WM_KEYUP message736 winMsg->lParam |= WIN_KEY_PREVSTATE; // bit 30, previous state, always 1 for a WM_KEYUP message 742 737 winMsg->lParam |= 1 << 31; // bit 31, transition state, always 1 for WM_KEYUP 743 738 } … … 747 742 winMsg->message = WINWM_SYSKEYDOWN; 748 743 if (keyWasPressed) 749 winMsg->lParam |= 1 << 30;// bit 30, previous state, 1 means key was pressed744 winMsg->lParam |= WIN_KEY_PREVSTATE; // bit 30, previous state, 1 means key was pressed 750 745 751 746 // pressed ALT-key generates additional flag 0x2000000 752 747 // if the current window has keyboard focus 753 winMsg->lParam |= 1 << 29;748 winMsg->lParam |= WIN_KEY_ALTHELD; 754 749 } 755 750 } … … 761 756 } 762 757 } 758 759 #ifdef ALTGR_HACK 760 // it's a PMSCAN_ALTRIGHT WM_CHAR message? 761 // and not previously translated? 762 if(fMsgRemoved && usPMScanCode == PMSCAN_ALTRIGHT && !(teb->o.odin.fTranslated)) 763 { 764 dprintf(("Queue ALTRIGHT message")); 765 // special ALTRIGHT treatment: 766 // we try to insert another WM_KEYDOWN or WM_KEYUP instead of 767 // the usual WM_CHAR which is expected here. 768 // -> experimental 769 // it's really an OS/2-style WM_CHAR message? 770 MSG extramsg; 771 memcpy(&extramsg, winMsg, sizeof(MSG)); 772 773 // AltGr is not released with WINWM_SYSKEYUP, but WINWM_KEYUP 774 if(flags & KC_KEYUP) 775 { 776 extramsg.message = WINWM_KEYUP; 777 } 778 extramsg.wParam = VK_RMENU_W; 779 780 // mask out message bits and scan code 781 extramsg.lParam &= (0xDC00FFFF); 782 extramsg.lParam |= (WINSCAN_ALTRIGHT & 0x1FF) << 16; 783 //// extramsg.lParam |= WIN_KEY_EXTENDED; 784 if (!(flags & KC_KEYUP)) 785 extramsg.lParam |= WIN_KEY_ALTHELD; 786 787 // insert message into the queue 788 setThreadQueueExtraCharMessage(teb, &extramsg); 789 } 790 #endif 763 791 break; 764 792 } … … 915 943 UCHAR ucPMScanCode = CHAR4FROMMP(teb->o.odin.os2msg.mp1); 916 944 ULONG fl = SHORT1FROMMP(teb->o.odin.os2msg.mp1); 917 918 919 // special ALTRIGHT treatment: 920 // we try to insert another WM_KEYDOWN or WM_KEYUP instead of 921 // the usual WM_CHAR which is expected here. 922 // -> experimental 923 if (ucPMScanCode == PMSCAN_ALTRIGHT) 924 { 925 // it's really an OS/2-style WM_CHAR message? 926 // and not previously translated? 927 if ( ( (teb->o.odin.os2msg.msg != WM_CHAR) && 928 (teb->o.odin.os2msg.msg != WM_CHAR_SPECIAL) ) || 929 (teb->o.odin.fTranslated) ) 930 return FALSE; 931 932 memcpy(&extramsg, msg, sizeof(MSG)); 933 934 // AltGr is not released with WINWM_SYSKEYUP, but WINWM_KEYUP 935 if (fl & KC_KEYUP) 936 { 937 extramsg.message = WINWM_KEYUP; 938 } 939 940 941 extramsg.wParam = VK_RMENU_W; 942 943 // mask out message bits and scan code 944 extramsg.lParam &= (0xDC00FFFF); 945 extramsg.lParam |= (WINSCAN_ALTRIGHT & 0x1FF) << 16; 946 extramsg.lParam |= WIN_KEY_EXTENDED; 947 if (!(fl & KC_KEYUP)) 948 extramsg.lParam |= WIN_KEY_ALTHELD; 949 950 // insert message into the queue 951 setThreadQueueExtraCharMessage(teb, &extramsg); 952 953 return TRUE; 954 } 945 955 946 956 947 //NOTE: These actually need to be posted so that the next message retrieved by GetMessage contains … … 1006 997 extramsg.lParam = msg->lParam & 0x00FFFFFF; 1007 998 if(fl & KC_ALT) 1008 extramsg.lParam |= (1<<29);999 extramsg.lParam |= WIN_KEY_ALTHELD; 1009 1000 if(fl & KC_PREVDOWN) 1010 extramsg.lParam |= (1<<30);1001 extramsg.lParam |= WIN_KEY_PREVSTATE; 1011 1002 if(fl & KC_KEYUP) 1012 1003 extramsg.lParam |= (1<<31); -
trunk/src/user32/winkeyboard.cpp
r7306 r7612 1 /* $Id: winkeyboard.cpp,v 1.2 6 2001-11-09 01:26:15 phallerExp $ */1 /* $Id: winkeyboard.cpp,v 1.27 2001-12-11 17:34:53 sandervl Exp $ */ 2 2 /* 3 3 * Win32 <-> PM key translation … … 593 593 594 594 // @@@PH 595 // Note: windo es uses different scancodes if numlock is pressed595 // Note: windows uses different scancodes if numlock is pressed 596 596 // This is not (yet) reflected here! 597 597 BYTE abPMScanToWinScan[256][2] = … … 708 708 /* 0x6B PMSCAN_F24 */ , WINSCAN_F24 ,FALSE 709 709 /* 0x6C PMSCAN_SYSMEM */ , 0x00 ,FALSE 710 /* 0x6D PMSCAN_ERASEEOF */ , WINSCAN_ERASEEOF,FALSE711 /* 0x6E PMSCAN_BREAK */ , WINSCAN_BREAK,TRUE710 /* 0x6D PMSCAN_ERASEEOF */ , 0x00 ,FALSE 711 /* 0x6E PMSCAN_BREAK */ , 0x00 ,TRUE 712 712 /* 0x6F PMSCAN_MOVEWIN */ , 0x00 ,FALSE 713 /* 0x70 PMSCAN_NLS3 */ , 0x00,FALSE714 /* 0x71 PMSCAN_HELP */ , WINSCAN_HELP,FALSE713 /* 0x70 PMSCAN_NLS3 */ , WINSCAN_NLS3 ,FALSE 714 /* 0x71 PMSCAN_HELP */ , 0x00 ,FALSE 715 715 /* 0x72 PMSCAN_TASKMAN */ , 0x00 ,FALSE 716 /* 0x73 PMSCAN_B11 */ , 0x00,FALSE716 /* 0x73 PMSCAN_B11 */ , WINSCAN_B11 ,FALSE 717 717 /* 0x74 PMSCAN_JUMP */ , 0x00 ,FALSE 718 718 /* 0x75 PMSCAN_MINWIN */ , 0x00 ,FALSE … … 720 720 /* 0x77 PMSCAN_77 */ , 0x00 ,FALSE 721 721 /* 0x78 PMSCAN_78 */ , 0x00 ,FALSE 722 /* 0x79 PMSCAN_NLS2 */ , 0x00,FALSE722 /* 0x79 PMSCAN_NLS2 */ , WINSCAN_NLS2 ,FALSE 723 723 /* 0x7a PMSCAN_SIZE */ , 0x00 ,FALSE 724 /* 0x7b PMSCAN_NLS1 */ , 0x00,FALSE725 /* 0x7c PMSCAN_APPLICATION */ , WINSCAN_ APPLICATION,TRUE726 /* 0x7d PMSCAN_E13 */ , 0x00,FALSE727 /* 0x7e PMSCAN */ , WINSCAN_ WINLEFT,TRUE728 /* 0x7f PMSCAN */ , WINSCAN_WINRIGHT,TRUE729 /* 0x80 PMSCAN_PA1 */ , WINSCAN_PA1,FALSE724 /* 0x7b PMSCAN_NLS1 */ , WINSCAN_NLS1 ,FALSE 725 /* 0x7c PMSCAN_APPLICATION */ , WINSCAN_WINAPPLICATION ,TRUE 726 /* 0x7d PMSCAN_E13 */ , WINSCAN_YEN ,FALSE 727 /* 0x7e PMSCAN */ , WINSCAN_ABNT_C2 ,TRUE 728 /* 0x7f PMSCAN */ , 0x00 ,TRUE 729 /* 0x80 PMSCAN_PA1 */ , 0x00 ,FALSE 730 730 /* 0x81 PMSCAN_F13 */ , WINSCAN_F13 ,FALSE 731 731 /* 0x82 PMSCAN_F14 */ , WINSCAN_F14 ,FALSE … … 736 736 /* 0x87 PMSCAN_TABRIGHT */ , 0x00 ,FALSE 737 737 /* 0x88 PMSCAN_NOOP */ , 0x00 ,FALSE 738 /* 0x89 PMSCAN_F16 */ , WINSCAN_F16,FALSE739 /* 0x8a PMSCAN_F17 */ , WINSCAN_F17,FALSE740 /* 0x8b PMSCAN_F18 */ , WINSCAN_F18,FALSE741 /* 0x8c PMSCAN_F19 */ , WINSCAN_F19,FALSE742 /* 0x8d PMSCAN_F20 */ , WINSCAN_ F20,FALSE743 /* 0x8e PMSCAN_F21 */ , WINSCAN_F21,FALSE744 /* 0x8f PMSCAN_F22 */ , WINSCAN_F22,FALSE745 /* 0x90 */ , 0x00,FALSE746 /* 0x91 */ , 0x00,FALSE747 /* 0x92 */ , 0x00,FALSE748 /* 0x93 */ , 0x00,FALSE749 /* 0x94 */ , 0x00,FALSE750 /* 0x95 */ , 0x00,FALSE751 /* 0x96 */ , 0x00,FALSE752 /* 0x97 */ , 0x00,FALSE738 /* 0x89 PMSCAN_F16 */ , 0x00 ,FALSE 739 /* 0x8a PMSCAN_F17 */ , 0x00 ,FALSE 740 /* 0x8b PMSCAN_F18 */ , 0x00 ,FALSE 741 /* 0x8c PMSCAN_F19 */ , 0x00 ,FALSE 742 /* 0x8d PMSCAN_F20 */ , WINSCAN_NUMPADEQUALS ,FALSE 743 /* 0x8e PMSCAN_F21 */ , 0x00 ,FALSE 744 /* 0x8f PMSCAN_F22 */ , 0x00 ,FALSE 745 /* 0x90 */ , WINSCAN_PREVTRACK ,FALSE 746 /* 0x91 */ , WINSCAN_AT ,FALSE 747 /* 0x92 */ , WINSCAN_COLON ,FALSE 748 /* 0x93 */ , WINSCAN_UNDERLINE ,FALSE 749 /* 0x94 */ , WINSCAN_KANJI ,FALSE 750 /* 0x95 */ , WINSCAN_STOP ,FALSE 751 /* 0x96 */ , WINSCAN_AX ,FALSE 752 /* 0x97 */ , WINSCAN_UNLABELED ,FALSE 753 753 /* 0x98 */ , 0x00 ,FALSE 754 /* 0x99 */ , 0x00,FALSE754 /* 0x99 */ , WINSCAN_NEXTTRACK ,FALSE 755 755 /* 0x9A */ , 0x00 ,FALSE 756 756 /* 0x9B */ , 0x00 ,FALSE … … 759 759 /* 0x9E */ , 0x00 ,FALSE 760 760 /* 0x9F */ , 0x00 ,FALSE 761 /* 0xA0 */ , 0x00,FALSE762 /* 0xA1 */ , 0x00,FALSE763 /* 0xA2 */ , 0x00,FALSE761 /* 0xA0 */ , WINSCAN_MUTE ,FALSE 762 /* 0xA1 */ , WINSCAN_CALCULATOR ,FALSE 763 /* 0xA2 */ , WINSCAN_PLAYPAUSE ,FALSE 764 764 /* 0xA3 */ , 0x00 ,FALSE 765 /* 0xA4 */ , 0x00,FALSE765 /* 0xA4 */ , WINSCAN_MEDIASTOP ,FALSE 766 766 /* 0xA5 */ , 0x00 ,FALSE 767 767 /* 0xA6 */ , 0x00 ,FALSE … … 773 773 /* 0xAC */ , 0x00 ,FALSE 774 774 /* 0xAD */ , 0x00 ,FALSE 775 /* 0xAE */ , 0x00,FALSE775 /* 0xAE */ , WINSCAN_VOLUMEDOWN ,FALSE 776 776 /* 0xAF */ , 0x00 ,FALSE 777 /* 0xB0 */ , 0x00,FALSE777 /* 0xB0 */ , WINSCAN_VOLUMEUP ,FALSE 778 778 /* 0xB1 */ , 0x00 ,FALSE 779 /* 0xB2 */ , 0x00,FALSE780 /* 0xB3 */ , 0x00,FALSE779 /* 0xB2 */ , WINSCAN_WEBHOME ,FALSE 780 /* 0xB3 */ , WINSCAN_NUMPADCOMMA ,FALSE 781 781 /* 0xB4 */ , 0x00 ,FALSE 782 782 /* 0xB5 */ , 0x00 ,FALSE … … 821 821 /* 0xDC */ , 0x00 ,FALSE 822 822 /* 0xDD */ , 0x00 ,FALSE 823 /* 0xDE */ , 0x00,FALSE824 /* 0xDF */ , 0x00,FALSE823 /* 0xDE */ , WINSCAN_POWER ,FALSE 824 /* 0xDF */ , WINSCAN_SLEEP ,FALSE 825 825 /* 0xE0 */ , 0x00 ,FALSE 826 826 /* 0xE1 */ , 0x00 ,FALSE 827 827 /* 0xE2 */ , 0x00 ,FALSE 828 /* 0xE3 */ , 0x00,FALSE828 /* 0xE3 */ , WINSCAN_WAKE ,FALSE 829 829 /* 0xE4 */ , 0x00 ,FALSE 830 /* 0xE5 */ , 0x00,FALSE831 /* 0xE6 */ , 0x00,FALSE832 /* 0xE7 */ , 0x00,FALSE833 /* 0xE8 */ , 0x00,FALSE834 /* 0xE9 */ , 0x00,FALSE835 /* 0xEA */ , 0x00,FALSE836 /* 0xEB */ , 0x00,FALSE837 /* 0xEC */ , 0x00,FALSE838 /* 0xED */ , 0x00,FALSE830 /* 0xE5 */ , WINSCAN_WEBSEARCH ,FALSE 831 /* 0xE6 */ , WINSCAN_WEBFAVORITES ,FALSE 832 /* 0xE7 */ , WINSCAN_WEBREFRESH ,FALSE 833 /* 0xE8 */ , WINSCAN_WEBSTOP ,FALSE 834 /* 0xE9 */ , WINSCAN_WEBFORWARD ,FALSE 835 /* 0xEA */ , WINSCAN_WEBBACK ,FALSE 836 /* 0xEB */ , WINSCAN_MYCOMPUTER ,FALSE 837 /* 0xEC */ , WINSCAN_MAIL ,FALSE 838 /* 0xED */ , WINSCAN_MEDIASELECT ,FALSE 839 839 /* 0xEE */ , 0x00 ,FALSE 840 840 /* 0xEF */ , 0x00 ,FALSE … … 1323 1323 // check the scancodes if the extended key bit is set so 1324 1324 // we can easily distinguish between "left" and "right" special keys, etc. 1325 BOOL fDontCare = (lParam & 0x02000000) != 0;1326 BOOL fExtended = (lParam & 0x01000000) != 0;1325 BOOL fDontCare = (lParam & WIN_KEY_DONTCARE) != 0; 1326 BOOL fExtended = (lParam & WIN_KEY_EXTENDED) != 0; 1327 1327 UCHAR ucWinScan = (lParam & 0x00ff0000) >> 16; 1328 1328 UCHAR ucWinVKey; … … 1420 1420 case KEYOVERLAYSTATE_UP: 1421 1421 return 0x0000; 1422 } 1423 1422 } 1424 1423 return O32_GetKeyState(nVirtKey); 1425 1424 } … … 1443 1442 case KEYOVERLAYSTATE_UP: 1444 1443 return 0x0000; 1445 } 1446 1447 if(fVersionWarp3) 1448 { 1449 dprintf(("WARNING: not correctly implemented for Warp 3")); 1450 //Not present in Warp 3's PMWINX 1451 return O32_GetKeyState(nVirtKey); 1452 } 1453 else 1454 return O32_GetAsyncKeyState(nVirtKey); 1444 } 1445 return O32_GetAsyncKeyState(nVirtKey); 1455 1446 } 1456 1447 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.