Changeset 7306 for trunk/src


Ignore:
Timestamp:
Nov 9, 2001, 2:26:15 AM (24 years ago)
Author:
phaller
Message:

some altgr fiddling

Location:
trunk/src/user32
Files:
3 edited

Legend:

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

    r7216 r7306  
    1 /* $Id: HOOK.CPP,v 1.32 2001-10-26 12:46:16 phaller Exp $ */
     1/* $Id: HOOK.CPP,v 1.33 2001-11-09 01:26:14 phaller Exp $ */
    22
    33/*
     
    859859  // Note: ALT seems to stick sometimes
    860860  // Note: ALTGR can't be queried
    861   BOOL fAltDown; // = GetAsyncKeyState(VK_LMENU);
     861  BOOL fAltDown = GetAsyncKeyState(VK_LMENU);
    862862 
    863863  // this bit indicates if ALT was held
    864   fAltDown = msg->lParam & 0x20000000;
     864  // fAltDown = msg->lParam & 0x20000000;
    865865 
    866866  kbhs.flags       = fKeyUp ? LLKHF_UP : 0;
  • trunk/src/user32/oslibmsgtranslate.cpp

    r7235 r7306  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.74 2001-10-27 09:06:02 phaller Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.75 2001-11-09 01:26:15 phaller Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    661661          {
    662662            winMsg->message = WINWM_SYSKEYUP;
    663 //            winMsg->lParam |= 1 << 29;                              // bit 29, alt was pressed
     663            winMsg->lParam |= 1 << 29;                              // bit 29, alt was pressed
    664664            winMsg->lParam |= 1 << 30;                              // bit 30, previous state, always 1 for a WM_KEYUP message
    665665            winMsg->lParam |= 1 << 31;                              // bit 31, transition state, always 1 for WM_KEYUP
     666           
     667            // Note: altgr affects the alt-key state in windows!
     668            // The overlay causes GetKeyState/GetAsyncKeyState to return
     669            // the correct states
     670            KeySetOverlayKeyState(VK_LMENU_W, KEYOVERLAYSTATE_DONTCARE);
     671            KeySetOverlayKeyState(VK_LCONTROL_W, KEYOVERLAYSTATE_DONTCARE);
     672            KeySetOverlayKeyState(VK_RMENU_W, KEYOVERLAYSTATE_DONTCARE);
    666673          }
    667674          else
     
    671678              winMsg->lParam |= 1 << 30;                          // bit 30, previous state, 1 means key was pressed
    672679            winMsg->message = WINWM_KEYDOWN;
     680           
     681            // Note: altgr affects the alt-key state in windows!
     682            // The overlay causes GetKeyState/GetAsyncKeyState to return
     683            // the correct states
     684            KeySetOverlayKeyState(VK_LMENU_W, KEYOVERLAYSTATE_DOWN);
     685            KeySetOverlayKeyState(VK_LCONTROL_W, KEYOVERLAYSTATE_DOWN);
     686            KeySetOverlayKeyState(VK_RMENU_W, KEYOVERLAYSTATE_DOWN);
    673687          }
    674688         
  • trunk/src/user32/winkeyboard.cpp

    r7221 r7306  
    1 /* $Id: winkeyboard.cpp,v 1.25 2001-10-26 15:54:04 phaller Exp $ */
     1/* $Id: winkeyboard.cpp,v 1.26 2001-11-09 01:26:15 phaller Exp $ */
    22/*
    33 * Win32 <-> PM key translation
     
    3232ODINDEBUGCHANNEL(USER32-WINKBD)
    3333
     34
     35/****************************************************************************
     36 * module local variables
     37 ****************************************************************************/
     38
     39static char arrchOverlayKeyState[256] = {0};
     40
     41
     42
     43
     44/****************************************************************************
     45 * implementation
     46 ****************************************************************************/
    3447
    3548BOOL OPEN32API _O32_GetKeyboardState( PBYTE lpKeyState );
     
    973986  if(rc == TRUE)
    974987  {
    975         KeyTranslatePMToWinBuf((BYTE *)&PMKeyState[0], lpKeyState, 256);
     988    KeyTranslatePMToWinBuf((BYTE *)&PMKeyState[0], lpKeyState, 256);
     989   
     990    // @@@PH
     991    // Note: we'd have to check the key state overlay array here, too!
     992   
    976993#ifdef DEBUG
    977994        for(int i=0;i<256;i++) {
     
    13891406              int,   nVirtKey)
    13901407{
     1408  // check overlay array first
     1409  char nState = arrchOverlayKeyState[nVirtKey & 0xff];
     1410  switch (nState)
     1411  {
     1412    case KEYOVERLAYSTATE_DONTCARE:
     1413      // forward processing ...
     1414      break;
     1415   
     1416    // @@@PH Note: key-toggle is not handled correctpy
     1417    case KEYOVERLAYSTATE_DOWN:
     1418      return 0x8000;
     1419     
     1420    case KEYOVERLAYSTATE_UP:
     1421      return 0x0000;
     1422  }
     1423   
    13911424  return O32_GetKeyState(nVirtKey);
    13921425}
     
    13961429              INT,   nVirtKey)
    13971430{
     1431  // check overlay array first
     1432  char nState = arrchOverlayKeyState[nVirtKey & 0xff];
     1433  switch (nState)
     1434  {
     1435    case KEYOVERLAYSTATE_DONTCARE:
     1436      // forward processing ...
     1437      break;
     1438   
     1439    // @@@PH Note: key-toggle is not handled correctpy
     1440    case KEYOVERLAYSTATE_DOWN:
     1441      return 0x8000;
     1442     
     1443    case KEYOVERLAYSTATE_UP:
     1444      return 0x0000;
     1445  }
     1446 
    13981447  if(fVersionWarp3)
    13991448  {
     
    17411790//******************************************************************************
    17421791//******************************************************************************
     1792
     1793// this is an internal function to emulate Alt-Gr behaviour
     1794ODINPROCEDURE2(KeySetOverlayKeyState,
     1795               int, nVirtKey,
     1796               char, nState)
     1797{
     1798  // setup overlay array
     1799  arrchOverlayKeyState[nVirtKey & 0xff] = nState;
     1800}
     1801
Note: See TracChangeset for help on using the changeset viewer.