Added the TEXT() and MAKELRESULT() definitions.
[wine/multimedia.git] / windows / mouse.c
blob7f9047d00dc0dd2ac48cca5f23ffb8012b08aa74
1 /*
2 * MOUSE driver
3 *
4 * Copyright 1998 Ulrich Weigand
5 *
6 */
8 #include <assert.h>
9 #include "windows.h"
10 #include "gdi.h"
11 #include "mouse.h"
12 #include "debug.h"
13 #include "debugtools.h"
14 #include "x11drv.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 /***********************************************************************
53 * MOUSE_SendEvent
55 void MOUSE_SendEvent( DWORD mouseStatus, DWORD posX, DWORD posY,
56 DWORD keyState, DWORD time, HWND32 hWnd )
58 extern BOOL32 DISPLAY_DisableWarpPointer;
59 WINE_MOUSEEVENT wme;
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;
71 wme.time = time;
72 wme.hWnd = hWnd;
74 DISPLAY_DisableWarpPointer = TRUE;
75 DefMouseEventProc( mouseStatus, posX, posY, 0, (DWORD)&wme );
76 DISPLAY_DisableWarpPointer = FALSE;