Changeset 9814 for trunk/src/user32/winkeyboard.cpp
- Timestamp:
- Feb 16, 2003, 7:29:27 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.