- Timestamp:
- Feb 16, 2003, 7:29:27 PM (23 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/oslibmsgtranslate.cpp
r9792 r9814 1 /* $Id: oslibmsgtranslate.cpp,v 1.10 1 2003-02-13 10:34:48sandervl Exp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.102 2003-02-16 18:29:26 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 602 602 break; 603 603 } 604 605 case WM_CHAR_SPECIAL_ALTGRCONTROL: 606 { 607 // special char message from the keyboard hook 608 dprintf(("PM: WM_CHAR_SPECIAL_ALTGRCONTROL")); 609 610 // NO BREAK! FALLTHRU CASE! 611 } 604 612 605 613 case WM_CHAR_SPECIAL: … … 607 615 // @@@PH 608 616 // special char message from the keyboard hook 609 dprintf(("PM: WM_CHAR_SPECIAL\n")); 617 if(os2Msg->msg == WM_CHAR_SPECIAL) { 618 dprintf(("PM: WM_CHAR_SPECIAL")); 619 } 610 620 611 621 // NO BREAK! FALLTHRU CASE! … … 689 699 { 690 700 // check for a lonesome ALT key ... 701 // SvL: Only Left Alt; AltGr generates a WM_KEYUP when released 691 702 if ( (flags & KC_LONEKEY) && 692 ( (winMsg->wParam == VK_LMENU_W) || (winMsg->wParam == VK_RMENU_W)) )703 (winMsg->wParam == VK_LMENU_W) ) 693 704 { 694 705 winMsg->message = WINWM_SYSKEYUP; … … 751 762 } 752 763 // if right alt is down, then we need to set the alt down bit too 753 if (WinGetKeyState(HWND_DESKTOP, VK_ALTGRAF) & 0x8000) { 764 // except for the fake Ctrl WM_CHAR sent for AltGr emulation 765 if (os2Msg->msg != WM_CHAR_SPECIAL_ALTGRCONTROL && 766 (WinGetKeyState(HWND_DESKTOP, VK_ALTGRAF) & 0x8000)) 767 { 754 768 winMsg->lParam |= WIN_KEY_ALTHELD; 755 769 } … … 781 795 } 782 796 } 797 #if 0 798 // 799 // AltGr needs special handling 800 // 801 // AltGr -> WM_KEYDOWN (VK_CONTROL), WM_KEYDOWN (VK_MENU) 802 // WM_SYSKEYUP (VK_CONTROL) 803 // WM_KEYUP (VK_MENU) 804 // 805 // Ctrl+AltGr -> WM_KEYDOWN (VK_CONTROL), WM_KEYUP (VK_CONTROL) 806 // WM_KEYDOWN (VK_MENU) 807 // WM_KEYUP (VK_MENU) 808 // WM_KEYUP (VK_CONTROL) 809 // 810 // AltGr+Ctrl -> WM_KEYDOWN (VK_CONTROL), WM_KEYDOWN (VK_MENU) 811 // WM_KEYDOWN (VK_CONTROL) 812 // WM_SYSKEYUP (VK_CONTROL) 813 // WM_SYSKEYUP (VK_CONTROL) 814 // WM_KEYUP (VK_MENU) 815 // 816 // AltGr down -> if Ctrl down, send WM_KEYUP (VK_CONTROL) 817 // endif 818 // Send WM_KEYDOWN (VK_CONTROL) 819 // Send WM_KEYDOWN (VK_MENU) 820 // AltGr up -> if !(Ctrl down before AltGr was pressed || Ctrl up) 821 // Send WM_SYSKEYUP (VK_CONTROL) 822 // endif 823 // Send WM_KEYDOWN (VK_MENU) 824 // 825 if(winMsg->wParam == VK_MENU_W && (winMsg->lParam & WIN_KEY_EXTENDED)) 826 {//AltGr 827 if(GetKeyState(VK_CONTROL_W) & 0x8000) 828 {//Ctrl key pressed, send WM_KEYUP 829 830 } 831 } 832 #endif 833 783 834 //After SetFocus(0), all keystrokes are converted in WM_SYS* 784 835 if(fIgnoreKeystrokes) { -
trunk/src/user32/winkeyboard.cpp
r9810 r9814 1 /* $Id: winkeyboard.cpp,v 1. 39 2003-02-16 15:31:12sandervl Exp $ */1 /* $Id: winkeyboard.cpp,v 1.40 2003-02-16 18:29:27 sandervl Exp $ */ 2 2 /* 3 3 * Win32 <-> PM key translation … … 985 985 { 986 986 #if 1 987 //temporary solution until we find out why OSLibWinGetScanStateTable always 988 //fails 987 989 int state; 988 990 for(int i=0;i<256;i++) { … … 993 995 } 994 996 } 995 return TRUE;996 #if 1997 997 #else 998 998 BYTE PMScanState[256]; … … 1022 1022 } 1023 1023 } 1024 #endif 1025 1026 //VK_LCONTROL needs special handling due to AltGr 1027 state = GetKeyState(VK_RMENU); 1028 if (state & 0x8000) 1029 {//if AltGr is down, then pretend VK_LCONTROL is down too 1030 lpKeyState[VK_LCONTROL] = ((state & 0x8000) >> 8) | (state & 1); 1031 lpKeyState[VK_CONTROL] = ((state & 0x8000) >> 8) | (state & 1); 1032 } 1033 1024 1034 //now process the mouse buttons (left, middle, right) 1025 1035 state = GetKeyState(VK_LBUTTON); … … 1041 1051 #endif 1042 1052 return TRUE; 1043 #endif1044 #else1045 BYTE PMKeyState[256];1046 BOOL rc;1047 1048 memset(PMKeyState, 0, sizeof(PMKeyState));1049 memset(lpKeyState, 0, 256);1050 rc = OSLibWinGetKeyboardStateTable((PBYTE)&PMKeyState[0] );1051 //// rc = O32_GetKeyboardState(lpKeyState);1052 if(rc == TRUE)1053 {1054 KeyTranslatePMToWinBuf((BYTE *)&PMKeyState[0], lpKeyState, 256);1055 1056 // @@@PH1057 // Note: we'd have to check the key state overlay array here, too!1058 1059 #ifdef DEBUG1060 for(int i=0;i<256;i++) {1061 if(PMKeyState[i] & 0x80) {1062 dprintf2(("PM key 0x%0x = %x", i, PMKeyState[i]));1063 }1064 }1065 for(i=0;i<256;i++) {1066 if(lpKeyState[i]) {1067 dprintf2(("Win key 0x%0x = %x", i, lpKeyState[i]));1068 }1069 }1070 #endif1071 return TRUE;1072 }1073 return FALSE;1074 #endif1075 1053 } 1076 1054 //****************************************************************************** … … 1477 1455 WORD result; 1478 1456 1457 if (nVirtKey == VK_CONTROL || nVirtKey == VK_LCONTROL) 1458 {//if AltGr is down, then pretend VK_LCONTROL is down too 1459 result = OSLibWinGetScanState(abWinVKeyToPMScan[VK_RMENU].bPMScanCode); 1460 if(result & 0x8000) { 1461 return result; 1462 } 1463 //not down, check the control keys 1464 } 1465 1479 1466 if (nVirtKey == VK_MENU) { 1480 1467 nVirtKey = VK_LMENU; … … 1528 1515 WORD result; 1529 1516 1517 if (nVirtKey == VK_CONTROL || nVirtKey == VK_LCONTROL) 1518 {//if AltGr is down, then pretend VK_LCONTROL is down too 1519 result = OSLibWinGetPhysKeyState(abWinVKeyToPMScan[VK_RMENU].bPMScanCode); 1520 if(result & 0x8000) { 1521 return result; 1522 } 1523 //not down, check the control keys 1524 } 1530 1525 if (nVirtKey == VK_MENU) { 1531 1526 nVirtKey = VK_LMENU;
Note:
See TracChangeset
for help on using the changeset viewer.