modified MsqTranslateMouseMessage() for Double clicks

svn path=/trunk/; revision=5922
This commit is contained in:
Thomas Bluemel 2003-08-29 19:17:32 +00:00
parent 37f50a72e5
commit b8025b214f
2 changed files with 50 additions and 73 deletions

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: mouse.c,v 1.39 2003/08/29 00:24:42 weiden Exp $
/* $Id: mouse.c,v 1.40 2003/08/29 19:17:31 weiden Exp $
*
* PROJECT: ReactOS kernel
* PURPOSE: Mouse
@ -152,7 +152,11 @@ IntDetectDblClick(PSYSTEM_CURSORINFO CurInfo, DWORD TickCount)
(dY <= CurInfo->DblClickHeight);
if(res)
{
CurInfo->LastBtnDown = 0; /* prevent sending 2 or more DBLCLK messages */
CurInfo->LastBtnDownX = CurInfo->x;
CurInfo->LastBtnDownY = CurInfo->y;
}
else
{
CurInfo->LastBtnDown = TickCount;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: msgqueue.c,v 1.20 2003/08/26 19:26:02 weiden Exp $
/* $Id: msgqueue.c,v 1.21 2003/08/29 19:17:32 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -172,15 +172,9 @@ MsqTranslateMouseMessage(HWND hWnd, UINT FilterLow, UINT FilterHigh,
PWINDOW_OBJECT ScopeWin, PUSHORT HitTest,
PPOINT ScreenPoint, PBOOL MouseClick)
{
static ULONG ClkTime = 0;
static USHORT ClkMessage = 0;
static HWND ClkWnd = 0;
static POINT ClkPos = {0, 0};
USHORT Msg = Message->Msg.message;
PWINDOW_OBJECT Window;
POINT Point;
ULONG Click = 0;
if ((Window = IntGetCaptureWindow()) == NULL)
{
@ -212,24 +206,20 @@ MsqTranslateMouseMessage(HWND hWnd, UINT FilterLow, UINT FilterHigh,
return(FALSE);
}
if (Msg == WM_LBUTTONDOWN || Msg == WM_RBUTTONDOWN || Msg == WM_MBUTTONDOWN)
if (Msg == WM_LBUTTONDBLCLK || Msg == WM_RBUTTONDBLCLK || Msg == WM_MBUTTONDBLCLK)
{
(*MouseClick) = Click = 1;
if (!(IntGetClassLong(Window, GCL_STYLE, FALSE) & CS_DBLCLKS) &&
((*HitTest) == HTCLIENT))
{
Msg -= (WM_LBUTTONDBLCLK - WM_LBUTTONDOWN);
/* FIXME set WindowStation's system cursor variables:
LastBtnDown to Msg.time
*/
}
if (Click)
else
{
if (IntGetClassLong(Window, GCL_STYLE, FALSE) & CS_DBLCLKS ||
(*HitTest) != HTCLIENT)
{
if (Msg == ClkMessage &&
Window->Self == ClkWnd &&
(Message->Msg.time - ClkTime) < 452 &&
abs(Message->Msg.pt.x - ClkPos.x) < 2 &&
abs(Message->Msg.pt.y - ClkPos.y) < 2)
{
Msg += (WM_LBUTTONDBLCLK - WM_LBUTTONDOWN);
Click++;
}
/* FIXME check if the dblclick was made in the same window, if
not, change it to a normal click message */
}
}
@ -243,29 +233,12 @@ MsqTranslateMouseMessage(HWND hWnd, UINT FilterLow, UINT FilterHigh,
else
{
Point = Message->Msg.pt;
Point.x -= Window->ClientRect.left;
Point.y -= Window->ClientRect.top;
}
/* FIXME: Check message filter. */
if (Remove && Click)
{
if (Click == 1)
{
ClkTime = Message->Msg.time;
ClkMessage = Msg;
ClkWnd = Window->Self;
ClkPos = (*ScreenPoint);
}
else
{
ClkTime = 0;
ClkWnd = NULL;
}
}
if (Remove)
{
Message->Msg.hwnd = Window->Self;