Ignore:
Timestamp:
Mar 17, 2003, 6:59:34 PM (22 years ago)
Author:
sandervl
Message:

GetKeyState and GetAsyncKeyState fixes for numpad keyboard

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/winkeyboard.cpp

    r9814 r9922  
    1 /* $Id: winkeyboard.cpp,v 1.40 2003-02-16 18:29:27 sandervl Exp $ */
     1/* $Id: winkeyboard.cpp,v 1.41 2003-03-17 17:59:34 sandervl Exp $ */
    22/*
    33 * Win32 <-> PM key translation
     
    14271427//    return O32_GetKeyNameText(arg1, arg2, arg3);
    14281428}
     1429
     1430//******************************************************************************
     1431//******************************************************************************
     1432ULONG WinConvertNumPadKey(ULONG winVKey)
     1433{
     1434 ULONG ret;
     1435 BYTE winKey;
     1436
     1437  switch (winVKey)
     1438  {
     1439   case VK_HOME:  ret = VK_NUMPAD7; break;
     1440   case VK_UP:    ret = VK_NUMPAD8; break;
     1441   case VK_PRIOR: ret = VK_NUMPAD9; break;
     1442   case VK_LEFT:  ret = VK_NUMPAD4; break;
     1443   case VK_RIGHT: ret = VK_NUMPAD6; break;
     1444   case VK_END:   ret = VK_NUMPAD1; break;
     1445   case VK_DOWN:  ret = VK_NUMPAD2; break;
     1446   case VK_NEXT:  ret = VK_NUMPAD3; break;
     1447   case VK_INSERT:ret = VK_NUMPAD0; break;
     1448   case VK_DELETE:ret = VK_DECIMAL; break;
     1449   default:
     1450           ret = winVKey;
     1451  }
     1452 dprintf(("Returning %x",ret)); 
     1453 return ret;
     1454}
     1455
    14291456//******************************************************************************
    14301457//******************************************************************************
     
    14641491      }
    14651492
     1493      if ((nVirtKey >= VK_PRIOR) && (nVirtKey <= VK_DELETE))
     1494      {
     1495         WORD numState = OSLibWinGetScanState(abWinVKeyToPMScan[VK_NUMLOCK].bPMScanCode) & 1;
     1496
     1497         if(!numState) {
     1498             //@PF We also keep track in PM how much times the key has been pressed
     1499             //in win32 we can ignore this information - if some apps will demand this
     1500             //this is TO-DO
     1501             nVirtKey2 = WinConvertNumPadKey(nVirtKey);
     1502         }
     1503      }
     1504      else     
    14661505      if (nVirtKey == VK_MENU)  {
    14671506          nVirtKey  = VK_LMENU;
     
    15231562          //not down, check the control keys
    15241563      }
     1564
     1565      if ((nVirtKey >= VK_PRIOR) && (nVirtKey <= VK_DELETE))
     1566      {
     1567         WORD numState = OSLibWinGetScanState(abWinVKeyToPMScan[VK_NUMLOCK].bPMScanCode) & 1;
     1568
     1569         if(!numState) {
     1570             //@PF We also keep track in PM how much times the key has been pressed
     1571             //in win32 we can ignore this information - if some apps will demand this
     1572             //this is TO-DO
     1573             nVirtKey2 = WinConvertNumPadKey(nVirtKey);
     1574         }
     1575      }
     1576      else     
    15251577      if (nVirtKey == VK_MENU)  {
    15261578          nVirtKey  = VK_LMENU;
Note: See TracChangeset for help on using the changeset viewer.