Ignore:
Timestamp:
May 29, 2000, 11:30:17 PM (25 years ago)
Author:
mike
Message:

Discard messages received multiple times.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/dinput/dinput.cpp

    r3502 r3631  
    1 /* $Id: dinput.cpp,v 1.6 2000-05-09 18:58:40 sandervl Exp $ */
     1/* $Id: dinput.cpp,v 1.7 2000-05-29 21:30:17 mike Exp $ */
    22/*              DirectInput
    33 *
     
    626626   SysKeyboardAImpl* This = (SysKeyboardAImpl*) current_keylock;
    627627   BYTE  scan = (lParam >> 16) & 0xFF;
     628
     629   /* messages may arrive mustiple times; we need to check for duplicates */
     630   static HWND   oldhwnd = NULL;
     631   static UINT   oldmsg  = 0;
     632   static WPARAM oldwParam = 0;
     633   static LPARAM oldlParam = 0;
     634
     635   if ((hwnd == oldhwnd) && (msg == oldmsg) && (wParam == oldwParam) && (lParam == oldlParam)) {
     636      // we already saw this message
     637      return TRUE;
     638   }
     639   oldhwnd = hwnd; oldmsg = msg; oldwParam = wParam; oldlParam = lParam;
    628640
    629641   // fake a key up transition for typematic repeat
Note: See TracChangeset for help on using the changeset viewer.