Ignore:
Timestamp:
Feb 16, 2003, 7:29:27 PM (23 years ago)
Author:
sandervl
Message:

Do not translate WM_KEYUP to WM_SYSKEYUP if AltGr released and KC_LONEKEY flag is set. (only for Alt); GetKeyboardState, GetKeyState, GetAsyncKeyState: pretend left Ctrl key is pressed if AltGr down

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:12 sandervl Exp $ */
     1/* $Id: winkeyboard.cpp,v 1.40 2003-02-16 18:29:27 sandervl Exp $ */
    22/*
    33 * Win32 <-> PM key translation
     
    985985{
    986986#if 1
     987   //temporary solution until we find out why OSLibWinGetScanStateTable always
     988   //fails
    987989   int state;
    988990   for(int i=0;i<256;i++) {
     
    993995       }
    994996   }
    995    return TRUE;
    996 #if 1
    997997#else
    998998   BYTE PMScanState[256];
     
    10221022       }
    10231023   }
     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
    10241034   //now process the mouse buttons (left, middle, right)
    10251035   state = GetKeyState(VK_LBUTTON);
     
    10411051#endif
    10421052   return TRUE;
    1043 #endif
    1044 #else
    1045  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     // @@@PH
    1057     // Note: we'd have to check the key state overlay array here, too!
    1058    
    1059 #ifdef DEBUG
    1060         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 #endif
    1071         return TRUE;
    1072   }
    1073   return FALSE;
    1074 #endif
    10751053}
    10761054//******************************************************************************
     
    14771455      WORD result;
    14781456
     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
    14791466      if (nVirtKey == VK_MENU)  {
    14801467          nVirtKey  = VK_LMENU;
     
    15281515      WORD result;
    15291516
     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      }
    15301525      if (nVirtKey == VK_MENU)  {
    15311526          nVirtKey  = VK_LMENU;
Note: See TracChangeset for help on using the changeset viewer.