mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 04:43:21 +00:00
implemented support for double clicks
svn path=/trunk/; revision=5898
This commit is contained in:
parent
9719db631e
commit
303749022b
5 changed files with 119 additions and 39 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: stubs.c,v 1.38 2003/08/28 14:22:05 weiden Exp $
|
/* $Id: stubs.c,v 1.39 2003/08/28 16:33:22 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS user32.dll
|
* PROJECT: ReactOS user32.dll
|
||||||
|
@ -142,17 +142,6 @@ EnableScrollBar(
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
|
||||||
UINT
|
|
||||||
STDCALL
|
|
||||||
GetDoubleClickTime(VOID)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
|
@ -372,18 +361,6 @@ ScrollWindowEx(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
|
||||||
WINBOOL
|
|
||||||
STDCALL
|
|
||||||
SetDoubleClickTime(
|
|
||||||
UINT uInterval)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: input.c,v 1.15 2003/08/28 14:22:05 weiden Exp $
|
/* $Id: input.c,v 1.16 2003/08/28 16:33:22 weiden Exp $
|
||||||
*
|
*
|
||||||
* PROJECT: ReactOS user32.dll
|
* PROJECT: ReactOS user32.dll
|
||||||
* FILE: lib/user32/windows/input.c
|
* FILE: lib/user32/windows/input.c
|
||||||
|
@ -100,6 +100,18 @@ GetAsyncKeyState(int vKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @unimplemented
|
||||||
|
*/
|
||||||
|
UINT
|
||||||
|
STDCALL
|
||||||
|
GetDoubleClickTime(VOID)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
|
@ -310,6 +322,19 @@ OemKeyScan(WORD wOemChar)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @unimplemented
|
||||||
|
*/
|
||||||
|
WINBOOL
|
||||||
|
STDCALL
|
||||||
|
SetDoubleClickTime(
|
||||||
|
UINT uInterval)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -39,6 +39,12 @@ typedef struct _SYSTEM_CURSORINFO
|
||||||
FAST_MUTEX CursorMutex;
|
FAST_MUTEX CursorMutex;
|
||||||
CURSORCLIP_INFO CursorClipInfo;
|
CURSORCLIP_INFO CursorClipInfo;
|
||||||
SYSCURSOR SystemCursors[SYSCURSORCOUNT];
|
SYSCURSOR SystemCursors[SYSCURSORCOUNT];
|
||||||
|
UINT DblClickSpeed;
|
||||||
|
UINT DblClickWidth;
|
||||||
|
UINT DblClickHeight;
|
||||||
|
DWORD LastBtnDown;
|
||||||
|
LONG LastBtnDownX;
|
||||||
|
LONG LastBtnDownY;
|
||||||
} SYSTEM_CURSORINFO, *PSYSTEM_CURSORINFO;
|
} SYSTEM_CURSORINFO, *PSYSTEM_CURSORINFO;
|
||||||
|
|
||||||
typedef struct _WINSTATION_OBJECT
|
typedef struct _WINSTATION_OBJECT
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: mouse.c,v 1.37 2003/08/28 14:22:05 weiden Exp $
|
/* $Id: mouse.c,v 1.38 2003/08/28 16:33:22 weiden Exp $
|
||||||
*
|
*
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* PURPOSE: Mouse
|
* PURPOSE: Mouse
|
||||||
|
@ -135,6 +135,40 @@ IntCheckClipCursor(LONG *x, LONG *y, PSYSTEM_CURSORINFO CurInfo)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL FASTCALL
|
||||||
|
IntDetectDblClick(PSYSTEM_CURSORINFO CurInfo, DWORD TickCount)
|
||||||
|
{
|
||||||
|
LONG dX, dY;
|
||||||
|
BOOL res = ((TickCount - CurInfo->LastBtnDown) < CurInfo->DblClickSpeed);
|
||||||
|
if(res)
|
||||||
|
{
|
||||||
|
/* check if the second click is within the DblClickWidth and DblClickHeight values */
|
||||||
|
dX = CurInfo->LastBtnDownX - CurInfo->x;
|
||||||
|
dY = CurInfo->LastBtnDownY - CurInfo->y;
|
||||||
|
if(dX < 0) dX = -dX;
|
||||||
|
if(dY < 0) dY = -dY;
|
||||||
|
|
||||||
|
res = (dX <= CurInfo->DblClickWidth) &&
|
||||||
|
(dY <= CurInfo->DblClickHeight);
|
||||||
|
|
||||||
|
if(res)
|
||||||
|
CurInfo->LastBtnDown = 0; /* prevent sending 2 or more DBLCLK messages */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CurInfo->LastBtnDown = TickCount;
|
||||||
|
CurInfo->LastBtnDownX = CurInfo->x;
|
||||||
|
CurInfo->LastBtnDownY = CurInfo->y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CurInfo->LastBtnDown = TickCount;
|
||||||
|
CurInfo->LastBtnDownX = CurInfo->x;
|
||||||
|
CurInfo->LastBtnDownY = CurInfo->y;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
BOOL FASTCALL
|
BOOL FASTCALL
|
||||||
IntSwapMouseButton(PWINSTATION_OBJECT WinStaObject, BOOL Swap)
|
IntSwapMouseButton(PWINSTATION_OBJECT WinStaObject, BOOL Swap)
|
||||||
{
|
{
|
||||||
|
@ -418,27 +452,48 @@ MouseGDICallBack(PMOUSE_INPUT_DATA Data, ULONG InputCount)
|
||||||
|
|
||||||
if (Data[i].ButtonFlags != 0)
|
if (Data[i].ButtonFlags != 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ((0 != Data[i].LastX) || (0 != Data[i].LastY))
|
|
||||||
{
|
|
||||||
MsqInsertSystemMessage(&Msg, FALSE);
|
|
||||||
MouseMoveAdded = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((Data[i].ButtonFlags & MOUSE_LEFT_BUTTON_DOWN) > 0)
|
if ((Data[i].ButtonFlags & MOUSE_LEFT_BUTTON_DOWN) > 0)
|
||||||
{
|
{
|
||||||
|
/* insert WM_MOUSEMOVE messages before Button down messages */
|
||||||
|
if ((0 != Data[i].LastX) || (0 != Data[i].LastY))
|
||||||
|
{
|
||||||
|
MsqInsertSystemMessage(&Msg, FALSE);
|
||||||
|
MouseMoveAdded = TRUE;
|
||||||
|
}
|
||||||
Msg.wParam = CurInfo->SwapButtons ? MK_RBUTTON : MK_LBUTTON;
|
Msg.wParam = CurInfo->SwapButtons ? MK_RBUTTON : MK_LBUTTON;
|
||||||
Msg.message = CurInfo->SwapButtons ? WM_RBUTTONDOWN : WM_LBUTTONDOWN;
|
if(IntDetectDblClick(CurInfo, TickCount))
|
||||||
|
Msg.message = CurInfo->SwapButtons ? WM_RBUTTONDBLCLK : WM_LBUTTONDBLCLK;
|
||||||
|
else
|
||||||
|
Msg.message = CurInfo->SwapButtons ? WM_RBUTTONDOWN : WM_LBUTTONDOWN;
|
||||||
}
|
}
|
||||||
if ((Data[i].ButtonFlags & MOUSE_MIDDLE_BUTTON_DOWN) > 0)
|
if ((Data[i].ButtonFlags & MOUSE_MIDDLE_BUTTON_DOWN) > 0)
|
||||||
{
|
{
|
||||||
|
/* insert WM_MOUSEMOVE messages before Button down messages */
|
||||||
|
if ((0 != Data[i].LastX) || (0 != Data[i].LastY))
|
||||||
|
{
|
||||||
|
MsqInsertSystemMessage(&Msg, FALSE);
|
||||||
|
MouseMoveAdded = TRUE;
|
||||||
|
}
|
||||||
Msg.wParam = MK_MBUTTON;
|
Msg.wParam = MK_MBUTTON;
|
||||||
Msg.message = WM_MBUTTONDOWN;
|
if(IntDetectDblClick(CurInfo, TickCount))
|
||||||
|
Msg.message = WM_MBUTTONDBLCLK;
|
||||||
|
else
|
||||||
|
Msg.message = WM_MBUTTONDOWN;
|
||||||
}
|
}
|
||||||
if ((Data[i].ButtonFlags & MOUSE_RIGHT_BUTTON_DOWN) > 0)
|
if ((Data[i].ButtonFlags & MOUSE_RIGHT_BUTTON_DOWN) > 0)
|
||||||
{
|
{
|
||||||
|
/* insert WM_MOUSEMOVE messages before Button down messages */
|
||||||
|
if ((0 != Data[i].LastX) || (0 != Data[i].LastY))
|
||||||
|
{
|
||||||
|
MsqInsertSystemMessage(&Msg, FALSE);
|
||||||
|
MouseMoveAdded = TRUE;
|
||||||
|
}
|
||||||
Msg.wParam = CurInfo->SwapButtons ? MK_LBUTTON : MK_RBUTTON;
|
Msg.wParam = CurInfo->SwapButtons ? MK_LBUTTON : MK_RBUTTON;
|
||||||
Msg.message = CurInfo->SwapButtons ? WM_LBUTTONDOWN : WM_RBUTTONDOWN;
|
if(IntDetectDblClick(CurInfo, TickCount))
|
||||||
|
Msg.message = CurInfo->SwapButtons ? WM_LBUTTONDBLCLK : WM_RBUTTONDBLCLK;
|
||||||
|
else
|
||||||
|
Msg.message = CurInfo->SwapButtons ? WM_LBUTTONDOWN : WM_RBUTTONDOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Data[i].ButtonFlags & MOUSE_LEFT_BUTTON_UP) > 0)
|
if ((Data[i].ButtonFlags & MOUSE_LEFT_BUTTON_UP) > 0)
|
||||||
|
@ -458,6 +513,15 @@ MouseGDICallBack(PMOUSE_INPUT_DATA Data, ULONG InputCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
MsqInsertSystemMessage(&Msg, FALSE);
|
MsqInsertSystemMessage(&Msg, FALSE);
|
||||||
|
|
||||||
|
/* insert WM_MOUSEMOVE messages after Button up messages */
|
||||||
|
if(!MouseMoveAdded && ((0 != Data[i].LastX) || (0 != Data[i].LastY)))
|
||||||
|
{
|
||||||
|
Msg.wParam = ButtonsDown;
|
||||||
|
Msg.message = WM_MOUSEMOVE;
|
||||||
|
MsqInsertSystemMessage(&Msg, FALSE);
|
||||||
|
MouseMoveAdded = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: winsta.c,v 1.31 2003/08/28 14:22:05 weiden Exp $
|
/* $Id: winsta.c,v 1.32 2003/08/28 16:33:22 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -354,14 +354,22 @@ NtUserCreateWindowStation(PUNICODE_STRING lpszWindowStationName,
|
||||||
|
|
||||||
ExInitializeFastMutex(&WinStaObject->SystemCursor.CursorMutex);
|
ExInitializeFastMutex(&WinStaObject->SystemCursor.CursorMutex);
|
||||||
WinStaObject->SystemCursor.Enabled = FALSE;
|
WinStaObject->SystemCursor.Enabled = FALSE;
|
||||||
WinStaObject->SystemCursor.SwapButtons = FALSE;
|
|
||||||
WinStaObject->SystemCursor.CurrentCursor = 0;
|
WinStaObject->SystemCursor.CurrentCursor = 0;
|
||||||
WinStaObject->SystemCursor.x = (LONG)0;
|
WinStaObject->SystemCursor.x = (LONG)0;
|
||||||
WinStaObject->SystemCursor.y = (LONG)0;
|
WinStaObject->SystemCursor.y = (LONG)0;
|
||||||
|
WinStaObject->SystemCursor.CursorClipInfo.IsClipped = FALSE;
|
||||||
|
WinStaObject->SystemCursor.LastBtnDown = 0;
|
||||||
|
|
||||||
|
/* FIXME Obtain the following information from the registry */
|
||||||
|
WinStaObject->SystemCursor.SwapButtons = FALSE;
|
||||||
WinStaObject->SystemCursor.SafetySwitch = FALSE;
|
WinStaObject->SystemCursor.SafetySwitch = FALSE;
|
||||||
WinStaObject->SystemCursor.SafetySwitch2 = TRUE;
|
WinStaObject->SystemCursor.SafetySwitch2 = TRUE;
|
||||||
WinStaObject->SystemCursor.CursorClipInfo.IsClipped = FALSE;
|
WinStaObject->SystemCursor.DblClickSpeed = 500;
|
||||||
|
WinStaObject->SystemCursor.DblClickWidth = 4;
|
||||||
|
WinStaObject->SystemCursor.DblClickHeight = 4;
|
||||||
|
|
||||||
|
/* FIXME tell user32 to load the cursors from it's rosource file or
|
||||||
|
to load the user's cursor scheme */
|
||||||
WinStaObject->SystemCursor.SystemCursors[0].hCursor = (HANDLE)1;
|
WinStaObject->SystemCursor.SystemCursors[0].hCursor = (HANDLE)1;
|
||||||
WinStaObject->SystemCursor.SystemCursors[0].cx = 32;
|
WinStaObject->SystemCursor.SystemCursors[0].cx = 32;
|
||||||
WinStaObject->SystemCursor.SystemCursors[0].cy = 32;
|
WinStaObject->SystemCursor.SystemCursors[0].cy = 32;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue