Changeset 7166 for trunk/src


Ignore:
Timestamp:
Oct 23, 2001, 10:39:05 AM (24 years ago)
Author:
phaller
Message:

.

Location:
trunk/src/user32
Files:
2 edited

Legend:

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

    r7164 r7166  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.63 2001-10-23 06:00:45 phaller Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.64 2001-10-23 08:36:20 phaller Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    3434#include "winmouse.h"
    3535#include <pmkbdhk.h>
     36#include <pmscan.h>
    3637
    3738#define DBG_LOCALLOG    DBG_oslibmsgtranslate
  • trunk/src/user32/winkeyboard.cpp

    r6972 r7166  
    1 /* $Id: winkeyboard.cpp,v 1.17 2001-10-09 05:18:05 phaller Exp $ */
     1/* $Id: winkeyboard.cpp,v 1.18 2001-10-23 08:36:20 phaller Exp $ */
    22/*
    33 * Win32 <-> PM key translation
     
    570570                             };
    571571
    572 
    573572//******************************************************************************
    574573//******************************************************************************
     
    587586   winkey[VK_CONTROL] = winkey[VK_LCONTROL] | winkey[VK_RCONTROL];
    588587   winkey[VK_MENU]    = winkey[VK_LMENU] | winkey[VK_RMENU];
     588}
     589//******************************************************************************
     590//******************************************************************************
     591BYTE KeyTranslateWinVKeyToPMScan(BYTE bWinScan)
     592{
     593  // Note: array size of 256, so the BYTE value can't overflow
     594 
     595  // translate scancode to vkey
     596  BYTE bWinVKey = MapVirtualKeyA(bWinScan ,3);
     597  return abWinVKeyToPMScan[bWinVKey];
    589598}
    590599//******************************************************************************
     
    942951              int,    nSize)
    943952{
    944   return O32_GetKeyNameText(lParam,lpString,nSize);
     953  // Note: Open32 expects PM Scancodes, NOT Winscancodes.
     954  UCHAR ucPMScanCode = KeyTranslateWinVKeyToPMScan( (lParam & 0x00ff0000) >> 16);
     955 
     956  // switch the bits
     957  lParam &= 0xFF00FFFF;
     958  lParam |= (ucPMScanCode << 16);
     959 
     960  // @@@PH
     961  // Bugs in Open32:
     962  // 1 - the "extended key bit" is not taken into account
     963  // 2 - special injected scancodes (0x21d for Ctrl for AltGr) skipped
     964 
     965  int result = O32_GetKeyNameText(lParam,lpString,nSize);
     966  if (result)
     967    dprintf(("keyname=[%s]\n",
     968             lpString));
     969  return result;
    945970}
    946971//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.