Changeset 7212 for trunk/src


Ignore:
Timestamp:
Oct 26, 2001, 12:04:13 PM (24 years ago)
Author:
phaller
Message:

.

Location:
trunk/src/user32
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/HOOK.CPP

    r7211 r7212  
    1 /* $Id: HOOK.CPP,v 1.30 2001-10-26 09:10:12 phaller Exp $ */
     1/* $Id: HOOK.CPP,v 1.31 2001-10-26 10:03:33 phaller Exp $ */
    22
    33/*
     
    791791   
    792792    case VK_LCONTROL:
    793     case VK_CONTROL:
    794     msg->wParam = VK_CONTROL; // 0x11
     793    case VK_RCONTROL:
     794      msg->wParam = VK_CONTROL; // 0x11
     795      break;
     796   
     797    case VK_LSHIFT:
     798    case VK_RSHIFT:
     799      msg->wParam = VK_SHIFT; // 0x10
    795800      break;
    796801  }
  • trunk/src/user32/oslibmsg.cpp

    r7211 r7212  
    1 /* $Id: oslibmsg.cpp,v 1.47 2001-10-26 09:10:12 phaller Exp $ */
     1/* $Id: oslibmsg.cpp,v 1.48 2001-10-26 10:03:34 phaller Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    248248        // if this is a keyup or keydown message, we've got to
    249249        // call the keyboard hook here
    250         if(pMsg->message <= WINWM_KEYLAST && pMsg->message >= WINWM_KEYDOWN)
     250        // send keyboard messages to the registered hooks
     251        switch (pMsg->message)
    251252        {
    252           ProcessKbdHook(pMsg, TRUE);
     253          case WINWM_KEYDOWN:
     254          case WINWM_KEYUP:
     255          case WINWM_SYSKEYDOWN:
     256          case WINWM_SYSKEYUP:
     257            // only supposed to be called upon WM_KEYDOWN
     258            // and WM_KEYUP according to docs.
     259            if(ProcessKbdHook(pMsg, TRUE))
     260              goto continuegetmsg;
     261            break;
    253262        }
    254263   
     
    300309 
    301310  // send keyboard messages to the registered hooks
    302   if(pMsg->message <= WINWM_KEYLAST && pMsg->message >= WINWM_KEYDOWN)
     311  switch (pMsg->message)
    303312  {
    304     // only supposed to be called upon WM_KEYDOWN
    305     // and WM_KEYUP according to docs.
    306     if(ProcessKbdHook(pMsg, TRUE))
    307       goto continuegetmsg;
    308   }
     313    case WINWM_KEYDOWN:
     314    case WINWM_KEYUP:
     315    case WINWM_SYSKEYDOWN:
     316    case WINWM_SYSKEYUP:
     317      // only supposed to be called upon WM_KEYDOWN
     318      // and WM_KEYUP according to docs.
     319      if(ProcessKbdHook(pMsg, TRUE))
     320        goto continuegetmsg;
     321      break;
     322  }
     323 
    309324  return rc;
    310325}
     
    374389        // if this is a keyup or keydown message, we've got to
    375390        // call the keyboard hook here
    376         if(pMsg->message <= WINWM_KEYLAST && pMsg->message >= WINWM_KEYDOWN)
     391        // send keyboard messages to the registered hooks
     392        switch (pMsg->message)
    377393        {
    378           ProcessKbdHook(pMsg, fRemove);
    379         }
     394          case WINWM_KEYDOWN:
     395          case WINWM_KEYUP:
     396          case WINWM_SYSKEYDOWN:
     397          case WINWM_SYSKEYUP:
     398            // only supposed to be called upon WM_KEYDOWN
     399            // and WM_KEYUP according to docs.
     400            if(ProcessKbdHook(pMsg, fRemove))
     401              goto continuepeekmsg;
     402            break;
     403        }
     404   
    380405        return TRUE;
    381406  }
     
    419444
    420445  // send keyboard messages to the registered hooks
    421   if(pMsg->message <= WINWM_KEYLAST && pMsg->message >= WINWM_KEYDOWN)
     446  switch (pMsg->message)
    422447  {
    423     // only supposed to be called upon WM_KEYDOWN
    424     // and WM_KEYUP according to docs.
    425     if(ProcessKbdHook(pMsg, fRemove))
    426       goto continuepeekmsg;
     448    case WINWM_KEYDOWN:
     449    case WINWM_KEYUP:
     450    case WINWM_SYSKEYDOWN:
     451    case WINWM_SYSKEYUP:
     452      // only supposed to be called upon WM_KEYDOWN
     453      // and WM_KEYUP according to docs.
     454      if(ProcessKbdHook(pMsg, fRemove))
     455        goto continuepeekmsg;
     456      break;
    427457  }
    428458
  • trunk/src/user32/oslibmsgtranslate.cpp

    r7211 r7212  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.69 2001-10-26 09:10:12 phaller Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.70 2001-10-26 10:03:34 phaller Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    3636#include <pmscan.h>
    3737#include <winscan.h>
     38#include <winkeyboard.h>
    3839
    3940#define DBG_LOCALLOG    DBG_oslibmsgtranslate
    4041#include "dbglocal.h"
    4142
     43
     44#if REDUNDANT_AND_BUGGY_DEFINITION
    4245// Formerly used method of translation based on OS/2 VKEY value didn't work
    4346// right. We need to take a look at the scan code we get from PM and derive
     
    8992    0xDE, 0x28,     // 0x28 '
    9093    0xC0, 0x29,     // 0x29 `
    91     0x10, 0x2A,     // 0x2A LShift
     94    VK_LSHIFT_W, 0x2A,     // 0x2A LShift
    9295    0xDC, 0x2B,     // 0x2B Bkslsh
    9396    0x5A, 0x2C,     // 0x2C z
     
    101104    0xBE, 0x34,     // 0x34 .
    102105    0xBF, 0x35,     // 0x35 /
    103     0x10, 0x36,     // 0x36 RShift
     106    VK_RSHIFT_W, 0x36,     // 0x36 RShift
    104107    0x6A, 0x37,     // 0x37 * Pad
    105108//  0x12, 0x38,     // 0x38 LAlt
     
    161164    0x5C, 0x15C     // 0x6F RMenu? (PM scan 0x7F)
    162165};
     166#endif
    163167
    164168static BOOL fGenerateDoubleClick = FALSE;
     
    730734VirtualKeyFound:
    731735//        dprintf (("VIRTUALKEYFOUND:(%x)", virtualKey));
    732 
     736     
     737        // @@@PH: what's this supposed to be?
    733738        // Adjust PM scancodes for Win* keys
    734739        if (scanCode >= 0x70)
    735             scanCode -= 0x10;
    736         winMsg->wParam  = pmscan2winkey[scanCode][0];
     740          scanCode -= 0x10;
     741     
     742      // winMsg->wParam  = pmscan2winkey[scanCode][0];
     743      // wWinScan  = pmscan2winkey[scanCode][1];
     744      {
     745        BOOL  fWinExtended;
     746        BYTE  bWinVKey;
     747        WORD  wWinScan;
     748       
     749        // Note: Numlock-state currently ignored, see below
     750        KeyTranslatePMScanToWinVKey(scanCode,
     751                                    FALSE,
     752                                    &bWinVKey,
     753                                    &wWinScan,
     754                                    &fWinExtended);
     755        winMsg->wParam = bWinVKey;
    737756        winMsg->lParam  = repeatCount & 0x0FFFF;                 // bit 0-15, repeatcount
    738         winMsg->lParam |= (pmscan2winkey[scanCode][1] & 0x1FF) << 16;  // bit 16-23, scancode + bit 15 extended
     757        winMsg->lParam |= (wWinScan & 0x1FF) << 16;  // bit 16-23, scancode + bit 15 extended
     758      }
    739759
    740760        // Adjust VKEY value for pad digits if NumLock is on
  • trunk/src/user32/winkeyboard.cpp

    r7201 r7212  
    1 /* $Id: winkeyboard.cpp,v 1.22 2001-10-25 13:16:57 phaller Exp $ */
     1/* $Id: winkeyboard.cpp,v 1.23 2001-10-26 10:03:34 phaller Exp $ */
    22/*
    33 * Win32 <-> PM key translation
     
    105105/* 0x34 PMSCAN_PERIOD       */ , VK_PERIOD                  ,FALSE
    106106/* 0x35 PMSCAN_SLASH        */ , VK_SLASH                   ,FALSE
    107 /* 0x36 PMSCAN_SHIFTRIGHT   */ , VK_RSHIFT                  ,FALSE
     107/* 0x36 PMSCAN_SHIFTRIGHT   */ , VK_RSHIFT                  ,TRUE
    108108/* 0x37 PMSCAN_PADASTERISK  */ , VK_MULTIPLY                ,FALSE
    109109/* 0x38 PMSCAN_ALTLEFT      */ , VK_LMENU                   ,FALSE
     
    640640/* 0x34 PMSCAN_PERIOD       */ , WINSCAN_PERIOD             ,FALSE
    641641/* 0x35 PMSCAN_SLASH        */ , WINSCAN_SLASH              ,FALSE
    642 /* 0x36 PMSCAN_SHIFTRIGHT   */ , WINSCAN_SHIFTRIGHT         ,FALSE
     642/* 0x36 PMSCAN_SHIFTRIGHT   */ , WINSCAN_SHIFTRIGHT         ,TRUE
    643643/* 0x37 PMSCAN_PADASTERISK  */ , WINSCAN_PADASTERISK        ,FALSE
    644644/* 0x38 PMSCAN_ALTLEFT      */ , WINSCAN_ALTLEFT            ,FALSE
     
    900900//******************************************************************************
    901901//******************************************************************************
     902void KeyTranslatePMScanToWinVKey(BYTE bPMScan,
     903                                 BOOL bNumLock,
     904                                 PBYTE pbWinVKey,
     905                                 WORD* pwWinScan,
     906                                 PBOOL pfExtended)
     907{
     908  // @@@PH numlock is currently ignored
     909  if (pbWinVKey)
     910    *pbWinVKey = abPMScanToWinVKey[bPMScan][0];
     911 
     912  if (pfExtended)
     913    *pfExtended = abPMScanToWinVKey[bPMScan][1];
     914 
     915  if (pwWinScan)
     916    *pwWinScan = abPMScanToWinScan[bPMScan][0];
     917}
     918//******************************************************************************
     919//******************************************************************************
    902920BYTE KeyTranslateWinScanToPMScan(BYTE bWinScan, BOOL fExtended)
    903921{
Note: See TracChangeset for help on using the changeset viewer.