Ignore:
Timestamp:
Mar 19, 2003, 11:29:48 AM (22 years ago)
Author:
sandervl
Message:

PF: Shift/Ctrl/Alt+Numpad keys illegal behaviour. Generic numpad keys like (/*-+) produced garbage

File:
1 edited

Legend:

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

    r9897 r9924  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.103 2003-03-04 15:57:35 sandervl Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.104 2003-03-19 10:29:48 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    634634        // special char message from the keyboard hook
    635635        dprintf(("PM: WM_CHAR_SPECIAL_ALTGRCONTROL"));
    636        
    637636      // NO BREAK! FALLTHRU CASE!
    638637    }
     
    645644            dprintf(("PM: WM_CHAR_SPECIAL"));
    646645        }
    647        
    648646      // NO BREAK! FALLTHRU CASE!
    649647    }
     
    688686            winMsg->lParam = winMsg->lParam | WIN_KEY_EXTENDED;
    689687
    690         if (!numPressed && (scanCode >= PMSCAN_PAD7) && (scanCode <= PMSCAN_PADPERIOD))
     688        //PF When we press shift we enable non-numeric functions of Numpad
     689        if ((!numPressed || (flags & KC_SHIFT)) && (scanCode >= PMSCAN_PAD7) && (scanCode <= PMSCAN_PADPERIOD))
    691690             winMsg->wParam = ConvertNumPadKey(scanCode);
    692691
     
    10351034  TEB *teb;
    10361035  MSG extramsg;
    1037 
     1036  BOOL   numPressed = (BOOL)(WinGetKeyState(HWND_DESKTOP,VK_NUMLOCK) & 1);       
    10381037  teb = GetThreadTEB();
    10391038  if(!teb)
     
    10421041  UCHAR ucPMScanCode = CHAR4FROMMP(teb->o.odin.os2msg.mp1);
    10431042  ULONG fl = SHORT1FROMMP(teb->o.odin.os2msg.mp1);
    1044  
     1043    
    10451044 
    10461045    //NOTE: These actually need to be posted so that the next message retrieved by GetMessage contains
     
    10641063        break;
    10651064      }
     1065     
     1066      // PF With NumLock off do not generate any WM_CHAR messages at all
     1067      // PADMINUS,PADPLUS fall in range of PAD7..PADPERIOD but they should generate WM_CHAR
     1068      // other PAD(X) buttons miss that range at all and thus generate WM_CHAR
     1069      if (!numPressed && (ucPMScanCode != PMSCAN_PADMINUS) && (ucPMScanCode != PMSCAN_PADPLUS) &&
     1070         (ucPMScanCode >= PMSCAN_PAD7) && (ucPMScanCode <= PMSCAN_PADPERIOD))
     1071        return FALSE;
    10661072
    10671073      if(!(fl & KC_CHAR) && msg->message < WINWM_SYSKEYDOWN)
     
    10811087            extramsg.wParam = msg->wParam - 0x30;
    10821088          else
    1083             extramsg.wParam = msg->wParam;
     1089           if (msg->wParam == VK_DECIMAL_W)
     1090             extramsg.wParam = VK_DELETE_W;
     1091           else
     1092             /* PM Sends Bogus Things when pressing Shift+NUMAsterisk */
     1093             if (msg->wParam != VK_MULTIPLY_W)
     1094                extramsg.wParam = msg->wParam;
    10841095        }
    10851096        else   
Note: See TracChangeset for help on using the changeset viewer.