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 )
58 extern BOOL32 DISPLAY_DisableWarpPointer;
61 if ( !DefMouseEventProc ) return;
63 TRACE( event, "(%04lX,%ld,%ld)\n", mouseStatus, posX, posY );
65 mouseStatus |= MOUSEEVENTF_ABSOLUTE;
66 posX = (((long)posX << 16) + screenWidth-1) / screenWidth;
67 posY = (((long)posY << 16) + screenHeight-1) / screenHeight;
69 wme.magic = WINE_MOUSEEVENT_MAGIC;
70 wme.keyState = keyState;
74 DISPLAY_DisableWarpPointer = TRUE;
75 DefMouseEventProc( mouseStatus, posX, posY, 0, (DWORD)&wme );
76 DISPLAY_DisableWarpPointer = FALSE;