1998-11-08 12:21:35 +00:00
|
|
|
/*
|
|
|
|
* MOUSE driver
|
2002-05-31 23:06:46 +00:00
|
|
|
*
|
1998-11-08 12:21:35 +00:00
|
|
|
* Copyright 1998 Ulrich Weigand
|
2002-05-31 23:06:46 +00:00
|
|
|
*
|
2002-03-09 23:29:33 +00:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
1998-11-08 12:21:35 +00:00
|
|
|
*/
|
|
|
|
|
2003-09-05 23:08:26 +00:00
|
|
|
#include <stdarg.h>
|
1999-09-20 18:49:02 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
2000-02-10 19:03:02 +00:00
|
|
|
#include "windef.h"
|
2001-12-17 21:35:42 +00:00
|
|
|
#include "winbase.h"
|
1999-04-01 08:16:08 +00:00
|
|
|
#include "winuser.h"
|
1999-12-06 01:20:00 +00:00
|
|
|
#include "wine/winbase16.h"
|
2005-12-09 10:51:17 +00:00
|
|
|
#include "wine/winuser16.h"
|
1999-02-04 14:05:38 +00:00
|
|
|
|
2000-06-08 04:57:22 +00:00
|
|
|
#include "pshpack1.h"
|
|
|
|
typedef struct _MOUSEINFO
|
|
|
|
{
|
|
|
|
BYTE msExist;
|
|
|
|
BYTE msRelative;
|
|
|
|
WORD msNumButtons;
|
|
|
|
WORD msRate;
|
|
|
|
WORD msXThreshold;
|
|
|
|
WORD msYThreshold;
|
|
|
|
WORD msXRes;
|
|
|
|
WORD msYRes;
|
|
|
|
WORD msMouseCommPort;
|
|
|
|
} MOUSEINFO, *LPMOUSEINFO;
|
|
|
|
#include "poppack.h"
|
|
|
|
|
2001-12-17 21:35:42 +00:00
|
|
|
static FARPROC16 DefMouseEventProc;
|
1998-11-08 12:21:35 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* Inquire (MOUSE.1)
|
1998-11-08 12:21:35 +00:00
|
|
|
*/
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2001-10-18 21:38:59 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* Enable (MOUSE.2)
|
|
|
|
*/
|
|
|
|
VOID WINAPI MOUSE_Enable( FARPROC16 proc )
|
1999-09-20 18:49:02 +00:00
|
|
|
{
|
2001-12-17 21:35:42 +00:00
|
|
|
DefMouseEventProc = proc;
|
1999-09-20 18:49:02 +00:00
|
|
|
}
|
|
|
|
|
1998-11-08 12:21:35 +00:00
|
|
|
/***********************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* Disable (MOUSE.3)
|
1998-11-08 12:21:35 +00:00
|
|
|
*/
|
|
|
|
VOID WINAPI MOUSE_Disable(VOID)
|
|
|
|
{
|
|
|
|
DefMouseEventProc = 0;
|
|
|
|
}
|
2004-12-08 14:15:24 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* SwapMouseButton (USER.186)
|
|
|
|
*/
|
|
|
|
BOOL16 WINAPI SwapMouseButton16( BOOL16 fSwap )
|
|
|
|
{
|
|
|
|
return SwapMouseButton( fSwap );
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* mouse_event (USER.299)
|
|
|
|
*/
|
|
|
|
void WINAPI mouse_event16( CONTEXT86 *context )
|
|
|
|
{
|
|
|
|
mouse_event( LOWORD(context->Eax), LOWORD(context->Ebx), LOWORD(context->Ecx),
|
|
|
|
LOWORD(context->Edx), MAKELONG(context->Esi, context->Edi) );
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* GetMouseEventProc (USER.337)
|
|
|
|
*/
|
|
|
|
FARPROC16 WINAPI GetMouseEventProc16(void)
|
|
|
|
{
|
|
|
|
HMODULE16 hmodule = GetModuleHandle16("USER");
|
|
|
|
return GetProcAddress16( hmodule, "mouse_event" );
|
|
|
|
}
|