4 * Copyright 1998 Ulrich Weigand
13 #include "debugtools.h"
16 static LPMOUSE_EVENT_PROC DefMouseEventProc
= NULL
;
18 /***********************************************************************
19 * MOUSE_Inquire (MOUSE.1)
21 WORD WINAPI
MOUSE_Inquire(LPMOUSEINFO mouseInfo
)
23 mouseInfo
->msExist
= TRUE
;
24 mouseInfo
->msRelative
= FALSE
;
25 mouseInfo
->msNumButtons
= 2;
26 mouseInfo
->msRate
= 34; /* the DDK says so ... */
27 mouseInfo
->msXThreshold
= 0;
28 mouseInfo
->msYThreshold
= 0;
29 mouseInfo
->msXRes
= 0;
30 mouseInfo
->msYRes
= 0;
31 mouseInfo
->msMouseCommPort
= 0;
33 return sizeof(MOUSEINFO
);
36 /***********************************************************************
37 * MOUSE_Enable (MOUSE.2)
39 VOID WINAPI
MOUSE_Enable(LPMOUSE_EVENT_PROC lpMouseEventProc
)
41 DefMouseEventProc
= lpMouseEventProc
;
44 /***********************************************************************
45 * MOUSE_Disable (MOUSE.3)
47 VOID WINAPI
MOUSE_Disable(VOID
)
49 DefMouseEventProc
= 0;
52 /***********************************************************************
55 void MOUSE_SendEvent( DWORD mouseStatus
, DWORD posX
, DWORD posY
,
56 DWORD keyState
, DWORD time
, HWND32 hWnd
)
60 if ( !DefMouseEventProc
) return;
62 TRACE( event
, "(%04lX,%ld,%ld)\n", mouseStatus
, posX
, posY
);
64 mouseStatus
|= MOUSEEVENTF_ABSOLUTE
;
65 posX
= (((long)posX
<< 16) + screenWidth
-1) / screenWidth
;
66 posY
= (((long)posY
<< 16) + screenHeight
-1) / screenHeight
;
68 wme
.magic
= WINE_MOUSEEVENT_MAGIC
;
69 wme
.keyState
= keyState
;
73 DefMouseEventProc( mouseStatus
, posX
, posY
, 0, (DWORD
)&wme
);