Changeset 7620 for trunk/src


Ignore:
Timestamp:
Dec 12, 2001, 5:40:45 PM (24 years ago)
Author:
sandervl
Message:

SendInput fix + handle Alt-F4 in default window handler

Location:
trunk/src/user32
Files:
6 edited

Legend:

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

    r7612 r7620  
    1 /* $Id: oslibmsg.cpp,v 1.51 2001-12-11 17:34:53 sandervl Exp $ */
     1/* $Id: oslibmsg.cpp,v 1.52 2001-12-12 16:40:43 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    658658//******************************************************************************
    659659//******************************************************************************
    660 
     660DWORD GetThreadMessageExtraInfo()
     661{
     662 TEB *teb;
     663
     664  teb = GetThreadTEB();
     665  if(teb)
     666  {
     667      return teb->o.odin.dwMsgExtraInfo;
     668  }
     669  dprintf(("GetThreadMessageExtraInfo: teb == NULL!!"));
     670  return 0;
     671}
     672//******************************************************************************
     673//******************************************************************************
     674DWORD SetThreadMessageExtraInfo(DWORD lParam)
     675{
     676 TEB *teb;
     677
     678  teb = GetThreadTEB();
     679  if(teb)
     680  {
     681        teb->o.odin.dwMsgExtraInfo = lParam;
     682  }
     683  else  dprintf(("SetThreadMessageExtraInfo: teb == NULL!!"));
     684  return 0;
     685}
     686//******************************************************************************
     687//******************************************************************************
  • trunk/src/user32/oslibmsgtranslate.cpp

    r7612 r7620  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.78 2001-12-11 17:34:53 sandervl Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.79 2001-12-12 16:40:43 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    557557      USHORT scanCode=0;
    558558      ULONG  flags = SHORT1FROMMP(os2Msg->mp1);
    559       BOOL   keyWasPressed, isExtended = FALSE;
     559      BOOL   keyWasPressed;
    560560      char   c;
    561561      USHORT usPMScanCode = CHAR4FROMMP(os2Msg->mp1);
    562562
    563       teb->o.odin.fTranslated = FALSE;
    564       repeatCount = CHAR3FROMMP(os2Msg->mp1);
    565       scanCode = CHAR4FROMMP(os2Msg->mp1);
    566       keyWasPressed = ((SHORT1FROMMP (os2Msg->mp1) & KC_PREVDOWN) == KC_PREVDOWN);
     563        teb->o.odin.fTranslated = FALSE;
     564        repeatCount = CHAR3FROMMP(os2Msg->mp1);
     565        scanCode = CHAR4FROMMP(os2Msg->mp1);
     566        keyWasPressed = ((SHORT1FROMMP (os2Msg->mp1) & KC_PREVDOWN) == KC_PREVDOWN);
    567567
    568568        dprintf(("PM: WM_CHAR: %x %x rep=%d scancode=%x", SHORT1FROMMP(os2Msg->mp2), SHORT2FROMMP(os2Msg->mp2), repeatCount, scanCode));
    569569        dprintf(("PM: WM_CHAR: hwnd %x flags %x mp1 %x, mp2 %x, time=%08xh", win32wnd->getWindowHandle(), flags, os2Msg->mp1, os2Msg->mp2, os2Msg->time));
    570570
    571         // vitali add begin
    572         if ( ( SHORT1FROMMP(os2Msg->mp2) & 0x0FF ) == 0x0E0 )
    573         {
    574             // an extended key ( arrows, ins, del and so on )
    575             // get "virtual" scancode from character code because
    576             // for "regular" keys they are equal
    577             if(!(flags & (KC_SHIFT|KC_ALT|KC_CTRL))) {
    578                 scanCode = ( SHORT1FROMMP(os2Msg->mp2) >> 8) & 0x0FF;
    579             }
    580             isExtended = TRUE;
    581         }
    582         // vitali add end
    583      
    584         // both WM_KEYUP & WM_KEYDOWN want a virtual key, find the right Win32 virtual key
    585         // given the OS/2 virtual key and OS/2 character
    586 
    587         //if (((SHORT1FROMMP (mp1) & KC_CHAR) == KC_CHAR) ||
    588         //    ((SHORT1FROMMP (mp1) & KC_LONEKEY) == KC_LONEKEY))
    589         c = 0;
    590         if ((SHORT1FROMMP (os2Msg->mp1) & 0xFF) != 0)
    591         {
    592             c = SHORT1FROMMP (os2Msg->mp2);
    593             if ((c >= 'A') && (c <= 'Z')) {
    594                 virtualKey = c;
    595                 goto VirtualKeyFound;
    596             }
    597             if ((c >='a') && (c <= 'z')) {
    598                 virtualKey = c - 32;   // make it uppercase
    599                 goto VirtualKeyFound;
    600             }
    601             if ((c >= '0') && (c <= '9')) {
    602                 virtualKey = c;
    603                 goto VirtualKeyFound;
    604             }
    605         }
    606 
    607 VirtualKeyFound:
    608 //        dprintf (("VIRTUALKEYFOUND:(%x)", virtualKey));
    609      
    610         // @@@PH: what's this supposed to be?
    611         // Adjust PM scancodes for Win* keys
    612         if (scanCode >= 0x70)
    613           scanCode -= 0x10;
    614         // winMsg->wParam  = pmscan2winkey[scanCode][0];
    615         // wWinScan  = pmscan2winkey[scanCode][1];
    616      
    617       {
    618571        BOOL  fWinExtended;
    619572        BYTE  bWinVKey;
     
    633586        if (fWinExtended)
    634587            winMsg->lParam = winMsg->lParam | WIN_KEY_EXTENDED;
    635       }
    636 
     588
     589#if 0
     590//TODO
    637591        // Adjust VKEY value for pad digits if NumLock is on
    638592        if ((scanCode >= 0x47) && (scanCode <= 0x53) &&
    639593            (virtualKey >= 0x30) && (virtualKey >= 39))
    640594            winMsg->wParam = virtualKey + 0x30;
    641      
     595#endif
    642596
    643597#ifdef ALTGR_HACK
  • trunk/src/user32/oslibutil.cpp

    r4658 r7620  
    1 /* $Id: oslibutil.cpp,v 1.6 2000-11-21 11:36:08 sandervl Exp $ */
     1/* $Id: oslibutil.cpp,v 1.7 2001-12-12 16:40:44 sandervl Exp $ */
    22/*
    33 * Window API utility functions for OS/2
     
    7676//******************************************************************************
    7777//******************************************************************************
    78 DWORD GetThreadMessageExtraInfo()
    79 {
    80  TEB *teb;
    81 
    82   teb = GetThreadTEB();
    83   if(teb)
    84   {
    85         return teb->o.odin.lParam;
    86   }
    87 
    88   dprintf(("GetThreadMessageExtraInfo: teb == NULL!!"));
    89   return 0;
    90 }
    91 //******************************************************************************
    92 //******************************************************************************
    93 DWORD SetThreadMessageExtraInfo(DWORD lParam)
    94 {
    95  TEB *teb;
    96 
    97   teb = GetThreadTEB();
    98   if(teb)
    99   {
    100         teb->o.odin.lParam = lParam;
    101   }
    102   else  dprintf(("SetThreadMessageExtraInfo: teb == NULL!!"));
    103   return 0;
    104 }
  • trunk/src/user32/win32wbase.cpp

    r7525 r7620  
    1 /* $Id: win32wbase.cpp,v 1.304 2001-12-02 12:22:01 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.305 2001-12-12 16:40:44 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    18121812            if( wParam == VK_F4 )       /* try to close the window */
    18131813            {
    1814                 HWND top = GetTopWindow();
     1814                HWND top = GetTopParent();
    18151815                if (!(GetClassLongW( top, GCL_STYLE ) & CS_NOCLOSE))
    18161816                    PostMessageW( top, WM_SYSCOMMAND, SC_CLOSE, 0 );
  • trunk/src/user32/windowmsg.cpp

    r6848 r7620  
    1 /* $Id: windowmsg.cpp,v 1.30 2001-09-27 10:42:59 phaller Exp $ */
     1/* $Id: windowmsg.cpp,v 1.31 2001-12-12 16:40:44 sandervl Exp $ */
    22/*
    33 * Win32 window message APIs for OS/2
     
    143143LONG WIN32API GetMessageExtraInfo()
    144144{
    145     dprintf(("USER32: GetMessageExtraInfo"));
     145    dprintf(("USER32: GetMessageExtraInfo %x", GetThreadMessageExtraInfo()));
    146146    return GetThreadMessageExtraInfo();
     147}
     148//******************************************************************************
     149//******************************************************************************
     150LPARAM WIN32API SetMessageExtraInfo(LPARAM lParam)
     151{
     152  dprintf(("USER32: SetMessageExtraInfo %x", lParam));
     153  return SetThreadMessageExtraInfo(lParam);
    147154}
    148155//******************************************************************************
     
    350357  dprintf(("USER32:  SendNotifyMessageW, not completely implemented\n"));
    351358  return(SendMessageA(hwnd, Msg, wParam, lParam));
    352 }
    353 //******************************************************************************
    354 //******************************************************************************
    355 LPARAM WIN32API SetMessageExtraInfo(LPARAM lParam)
    356 {
    357   dprintf(("USER32:  SetMessageExtraInfo\n"));
    358   return SetThreadMessageExtraInfo(lParam);
    359359}
    360360/*****************************************************************************
  • trunk/src/user32/winmouse.cpp

    r7028 r7620  
    1 /* $Id: winmouse.cpp,v 1.19 2001-10-12 07:05:15 phaller Exp $ */
     1/* $Id: winmouse.cpp,v 1.20 2001-12-12 16:40:45 sandervl Exp $ */
    22/*
    33 * Mouse handler for DINPUT
     
    340340        MSG msg;
    341341        BOOL fUnicode = (p->dwFlags & KEYEVENTF_UNICODE) == KEYEVENTF_UNICODE;
     342        DWORD extrainfo = GetMessageExtraInfo();
    342343       
    343344        // build keyboard message
     
    379380        // @@@PH
    380381        // unknown: do we have to post or to send the message?
     382
     383        SetMessageExtraInfo( (LPARAM)p->dwExtraInfo );
    381384       
    382385        if (fUnicode)
    383           PostMessageW(hwnd, msg.message, msg.wParam, msg.lParam);
     386          SendMessageW(hwnd, msg.message, msg.wParam, msg.lParam);
    384387        else
    385           PostMessageA(hwnd, msg.message, msg.wParam, msg.lParam);
    386        
    387         SetMessageExtraInfo( (LPARAM)p->dwExtraInfo );
     388          SendMessageA(hwnd, msg.message, msg.wParam, msg.lParam);
     389       
     390        //restore extra info
     391        SetMessageExtraInfo(extrainfo);
     392        break;
    388393      } 
    389       break;
    390394     
    391395      case INPUT_HARDWARE:
Note: See TracChangeset for help on using the changeset viewer.