experimental mouse click lock feature

svn path=/trunk/; revision=43420
This commit is contained in:
Matthias Kupfer 2009-10-12 21:08:35 +00:00
parent 9928349968
commit d5a7f4b694
3 changed files with 54 additions and 0 deletions

View file

@ -197,6 +197,8 @@ MsqPostHotKeyMessage(PVOID Thread, HWND hWnd, WPARAM wParam, LPARAM lParam);
VOID FASTCALL
MsqInsertSystemMessage(MSG* Msg);
BOOL FASTCALL
MsqIsClkLck(LPMSG Msg, BOOL Remove);
BOOL FASTCALL
MsqIsDblClk(LPMSG Msg, BOOL Remove);
HWND FASTCALL
MsqSetStateWindow(PUSER_MESSAGE_QUEUE MessageQueue, ULONG Type, HWND hWnd);

View file

@ -673,6 +673,15 @@ co_IntTranslateMouseMessage(PUSER_MESSAGE_QUEUE ThreadQueue, LPMSG Msg, USHORT *
*HitTest = HTCLIENT;
}
if (gspv.bMouseClickLock && ((Msg->message == WM_LBUTTONUP) || (Msg->message == WM_LBUTTONDOWN)))
{
if (MsqIsClkLck(Msg, Remove))
{
// FIXME: drop the message, hack: use WM_NULL
Msg->message = WM_NULL;
}
}
if(IS_BTN_MESSAGE(Msg->message, DOWN))
{
/* generate double click messages, if necessary */

View file

@ -232,6 +232,49 @@ MsqInsertSystemMessage(MSG* Msg)
KeSetEvent(&HardwareMessageEvent, IO_NO_INCREMENT, FALSE);
}
BOOL FASTCALL
MsqIsClkLck(LPMSG Msg, BOOL Remove)
{
PTHREADINFO pti;
PWINSTATION_OBJECT WinStaObject;
PSYSTEM_CURSORINFO CurInfo;
BOOL Res = FALSE;
pti = PsGetCurrentThreadWin32Thread();
if (pti->Desktop == NULL)
{
return FALSE;
}
WinStaObject = pti->Desktop->WindowStation;
CurInfo = IntGetSysCursorInfo(WinStaObject);
switch (Msg->message)
{
case WM_LBUTTONUP:
Res = ((Msg->time - CurInfo->ClickLockTime) >= gspv.dwMouseClickLockTime);
if (Res && (!CurInfo->ClickLockActive))
{
CurInfo->ClickLockActive = TRUE;
}
break;
case WM_LBUTTONDOWN:
if (CurInfo->ClickLockActive)
{
Res = TRUE;
CurInfo->ClickLockActive = FALSE;
CurInfo->ClickLockTime = 0;
}
else
{
CurInfo->ClickLockTime = Msg->time;
}
break;
}
return Res;
}
BOOL FASTCALL
MsqIsDblClk(LPMSG Msg, BOOL Remove)
{