Ignore:
Timestamp:
Apr 30, 2002, 4:54:07 PM (23 years ago)
Author:
sandervl
Message:

Implemented WH_MOUSE_LL hook; removed DInput hack for keyboard & mouse message translation

File:
1 edited

Legend:

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

    r8129 r8347  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.84 2002-03-28 11:25:59 sandervl Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.85 2002-04-30 14:54:06 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    3737#include <winscan.h>
    3838#include <winkeyboard.h>
     39#include "hook.h"
    3940
    4041#define DBG_LOCALLOG    DBG_oslibmsgtranslate
     
    341342        }
    342343        EnableLogging();
    343         if((fMsgRemoved == MSG_REMOVE) && ISMOUSE_CAPTURED())
    344         {
    345             if(DInputMouseHandler(win32wnd->getWindowHandle(), winMsg->message, winMsg->pt.x, winMsg->pt.y)) {
    346                 goto dummymessage; //dinput swallowed message
    347             }
    348         }
    349344
    350345        if(fWasDisabled) {
     
    385380        EnableLogging();
    386381
     382        if(fMsgRemoved == MSG_REMOVE)
     383        {
     384            MSLLHOOKSTRUCT hook;
     385
     386            hook.pt.x        = os2Msg->ptl.x & 0xFFFF;
     387            hook.pt.y        = mapScreenY(os2Msg->ptl.y);
     388            hook.mouseData   = 0;  //todo: XBUTTON1/2 (XP feature) or wheel data
     389            hook.flags       = 0;  //todo: injected (LLMHF_INJECTED)
     390            hook.time        = winMsg->time;
     391            hook.dwExtraInfo = 0;
     392
     393            if(HOOK_CallHooksW( WH_MOUSE_LL, HC_ACTION, winMsg->message, (LPARAM)&hook)) {
     394                goto dummymessage; //hook swallowed message
     395            }
     396        }
    387397        break;
    388398    }
     
    453463        }
    454464        EnableLogging();
    455         if((fMsgRemoved == MSG_REMOVE) && ISMOUSE_CAPTURED())
    456         {
    457             if(DInputMouseHandler(win32wnd->getWindowHandle(), winMsg->message, winMsg->pt.x, winMsg->pt.y)) {
    458                 goto dummymessage; //dinput swallowed message
    459             }
    460         }
    461465        if(fWasDisabled) {
    462                 if(win32wnd) {
    463                     winMsg->hwnd = win32wnd->getWindowHandle();
    464                 }
    465                 else {
    466                     goto dummymessage; //don't send mouse messages to disabled windows
    467                 }
    468         }
    469         //OS/2 Window coordinates -> Win32 Window coordinates
     466            if(win32wnd) {
     467                winMsg->hwnd = win32wnd->getWindowHandle();
     468            }
     469            else {
     470                goto dummymessage; //don't send mouse messages to disabled windows
     471            }
     472        }
     473        if(fMsgRemoved == MSG_REMOVE)
     474        {
     475            MSLLHOOKSTRUCT hook;
     476
     477            hook.pt.x        = os2Msg->ptl.x & 0xFFFF;
     478            hook.pt.y        = mapScreenY(os2Msg->ptl.y);
     479            hook.mouseData   = 0;
     480            hook.flags       = 0;  //todo: injected (LLMHF_INJECTED)
     481            hook.time        = winMsg->time;
     482            hook.dwExtraInfo = 0;
     483
     484            if(HOOK_CallHooksW( WH_MOUSE_LL, HC_ACTION, winMsg->message, (LPARAM)&hook)) {
     485                goto dummymessage; //hook swallowed message
     486            }
     487        }
    470488        break;
    471489    }
    472490
    473491    case WM_CONTROL:
    474       goto dummymessage;
     492        goto dummymessage;
    475493
    476494    case WM_COMMAND:
     
    742760        }
    743761
    744         if (ISKDB_CAPTURED())
    745         {
    746             if (DInputKeyBoardHandler(winMsg)) {
    747                 goto dummymessage; //dinput swallowed message
    748             }
    749         }
    750 
    751762#ifdef ALTGR_HACK
    752763        // it's a PMSCAN_ALTRIGHT WM_CHAR message?
Note: See TracChangeset for help on using the changeset viewer.