Commit bf844a4f authored by Ulrich Weigand's avatar Ulrich Weigand Committed by Alexandre Julliard

Implementation of MOUSE.DRV (contains some code taken from

windows/event.c).
parent d1b919c7
name mouse name mouse
type win16 type win16
1 pascal16 Inquire(ptr) MouseInquire 1 pascal16 Inquire(ptr) MOUSE_Inquire
2 pascal16 Enable(segptr) MouseEnable 2 pascal16 Enable(segptr) THUNK_MOUSE_Enable
3 pascal16 Disable() MouseDisable 3 pascal16 Disable() MOUSE_Disable
4 stub MOUSEGETINTVECT 4 stub MOUSEGETINTVECT
5 stub GETSETMOUSEDATA 5 stub GETSETMOUSEDATA
#Control Panel thinks this is implemented if it is available #Control Panel thinks this is implemented if it is available
......
/*
* MOUSE driver interface
*
* Copyright 1998 Ulrich Weigand
*/
#ifndef __WINE_MOUSE_H
#define __WINE_MOUSE_H
#pragma pack(1)
typedef struct _MOUSEINFO
{
BYTE msExist;
BYTE msRelative;
WORD msNumButtons;
WORD msRate;
WORD msXThreshold;
WORD msYThreshold;
WORD msXRes;
WORD msYRes;
WORD msMouseCommPort;
} MOUSEINFO, *LPMOUSEINFO;
#pragma pack(4)
typedef VOID (CALLBACK *LPMOUSE_EVENT_PROC)(DWORD,DWORD,DWORD,DWORD,DWORD);
WORD WINAPI MOUSE_Inquire(LPMOUSEINFO lpMouseInfo);
VOID WINAPI MOUSE_Enable(LPMOUSE_EVENT_PROC lpMouseEventProc);
VOID WINAPI MOUSE_Disable(VOID);
/* Wine internals */
#define WINE_MOUSEEVENT_MAGIC ( ('M'<<24)|('A'<<16)|('U'<<8)|'S' )
typedef struct _WINE_MOUSEEVENT
{
DWORD magic;
DWORD keyState;
DWORD time;
HWND32 hWnd;
} WINE_MOUSEEVENT;
void MOUSE_SendEvent( DWORD mouseStatus, DWORD posX, DWORD posY,
DWORD keyState, DWORD time, HWND32 hWnd );
#endif /* __WINE_MOUSE_H */
/*
* MOUSE driver
*
* Copyright 1998 Ulrich Weigand
*
*/
#include <assert.h>
#include "windows.h"
#include "gdi.h"
#include "mouse.h"
#include "debug.h"
#include "debugtools.h"
static LPMOUSE_EVENT_PROC DefMouseEventProc = NULL;
/***********************************************************************
* MOUSE_Inquire (MOUSE.1)
*/
WORD WINAPI MOUSE_Inquire(LPMOUSEINFO mouseInfo)
{
mouseInfo->msExist = TRUE;
mouseInfo->msRelative = FALSE;
mouseInfo->msNumButtons = 2;
mouseInfo->msRate = 34; /* the DDK says so ... */
mouseInfo->msXThreshold = 0;
mouseInfo->msYThreshold = 0;
mouseInfo->msXRes = 0;
mouseInfo->msYRes = 0;
mouseInfo->msMouseCommPort = 0;
return sizeof(MOUSEINFO);
}
/***********************************************************************
* MOUSE_Enable (MOUSE.2)
*/
VOID WINAPI MOUSE_Enable(LPMOUSE_EVENT_PROC lpMouseEventProc)
{
DefMouseEventProc = lpMouseEventProc;
}
/***********************************************************************
* MOUSE_Disable (MOUSE.3)
*/
VOID WINAPI MOUSE_Disable(VOID)
{
DefMouseEventProc = 0;
}
/***********************************************************************
* MOUSE_SendEvent
*/
void MOUSE_SendEvent( DWORD mouseStatus, DWORD posX, DWORD posY,
DWORD keyState, DWORD time, HWND32 hWnd )
{
WINE_MOUSEEVENT wme;
if ( !DefMouseEventProc ) return;
TRACE( event, "(%04lX,%ld,%ld)\n", mouseStatus, posX, posY );
mouseStatus |= MOUSEEVENTF_ABSOLUTE;
posX = (((long)posX << 16) + screenWidth-1) / screenWidth;
posY = (((long)posY << 16) + screenHeight-1) / screenHeight;
wme.magic = WINE_MOUSEEVENT_MAGIC;
wme.keyState = keyState;
wme.time = time;
wme.hWnd = hWnd;
DefMouseEventProc( mouseStatus, posX, posY, 0, (DWORD)&wme );
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment