Implement NtUserGetAsyncKeyState and support for TrackMouseEvent.

svn path=/trunk/; revision=16509
This commit is contained in:
James Tabor 2005-07-08 12:16:47 +00:00
parent 6c4cbed9a2
commit 622c4d86e9
3 changed files with 30 additions and 10 deletions

View file

@ -35,6 +35,8 @@
#define NDEBUG
#include <debug.h>
extern BYTE QueueKeyStateTable[];
/* GLOBALS *******************************************************************/
static HANDLE MouseDeviceHandle;
@ -986,36 +988,42 @@ IntMouseInput(MOUSEINPUT *mi)
Msg.message = 0;
if(mi->dwFlags & MOUSEEVENTF_LEFTDOWN)
{
QueueKeyStateTable[VK_LBUTTON] |= 0xc0;
Msg.message = SwapBtnMsg[0][SwapButtons];
CurInfo->ButtonsDown |= SwapBtn[SwapButtons];
MsqInsertSystemMessage(&Msg);
}
else if(mi->dwFlags & MOUSEEVENTF_LEFTUP)
{
QueueKeyStateTable[VK_LBUTTON] &= ~0x80;
Msg.message = SwapBtnMsg[1][SwapButtons];
CurInfo->ButtonsDown &= ~SwapBtn[SwapButtons];
MsqInsertSystemMessage(&Msg);
}
if(mi->dwFlags & MOUSEEVENTF_MIDDLEDOWN)
{
QueueKeyStateTable[VK_MBUTTON] |= 0xc0;
Msg.message = WM_MBUTTONDOWN;
CurInfo->ButtonsDown |= MK_MBUTTON;
MsqInsertSystemMessage(&Msg);
}
else if(mi->dwFlags & MOUSEEVENTF_MIDDLEUP)
{
QueueKeyStateTable[VK_MBUTTON] &= ~0x80;
Msg.message = WM_MBUTTONUP;
CurInfo->ButtonsDown &= ~MK_MBUTTON;
MsqInsertSystemMessage(&Msg);
}
if(mi->dwFlags & MOUSEEVENTF_RIGHTDOWN)
{
QueueKeyStateTable[VK_RBUTTON] |= 0xc0;
Msg.message = SwapBtnMsg[0][!SwapButtons];
CurInfo->ButtonsDown |= SwapBtn[!SwapButtons];
MsqInsertSystemMessage(&Msg);
}
else if(mi->dwFlags & MOUSEEVENTF_RIGHTUP)
{
QueueKeyStateTable[VK_RBUTTON] &= ~0x80;
Msg.message = SwapBtnMsg[1][!SwapButtons];
CurInfo->ButtonsDown &= ~SwapBtn[!SwapButtons];
MsqInsertSystemMessage(&Msg);
@ -1033,12 +1041,14 @@ IntMouseInput(MOUSEINPUT *mi)
Msg.message = WM_XBUTTONDOWN;
if(mi->mouseData & XBUTTON1)
{
QueueKeyStateTable[VK_XBUTTON1] |= 0xc0;
Msg.wParam = MAKEWPARAM(CurInfo->ButtonsDown, XBUTTON1);
CurInfo->ButtonsDown |= XBUTTON1;
MsqInsertSystemMessage(&Msg);
}
if(mi->mouseData & XBUTTON2)
{
QueueKeyStateTable[VK_XBUTTON2] |= 0xc0;
Msg.wParam = MAKEWPARAM(CurInfo->ButtonsDown, XBUTTON2);
CurInfo->ButtonsDown |= XBUTTON2;
MsqInsertSystemMessage(&Msg);
@ -1049,12 +1059,14 @@ IntMouseInput(MOUSEINPUT *mi)
Msg.message = WM_XBUTTONUP;
if(mi->mouseData & XBUTTON1)
{
QueueKeyStateTable[VK_XBUTTON1] &= 0x80;
Msg.wParam = MAKEWPARAM(CurInfo->ButtonsDown, XBUTTON1);
CurInfo->ButtonsDown &= ~XBUTTON1;
MsqInsertSystemMessage(&Msg);
}
if(mi->mouseData & XBUTTON2)
{
QueueKeyStateTable[VK_XBUTTON2] &= 0x80;
Msg.wParam = MAKEWPARAM(CurInfo->ButtonsDown, XBUTTON2);
CurInfo->ButtonsDown &= ~XBUTTON2;
MsqInsertSystemMessage(&Msg);

View file

@ -331,6 +331,24 @@ NtUserGetKeyState(
return ret;
}
DWORD
STDCALL
NtUserGetAsyncKeyState(
DWORD key)
{
DWORD ret = 0;
IntLockQueueState;
if( key < 0x100 ) {
ret = ((DWORD)(QueueKeyStateTable[key] & KS_DOWN_BIT) << 8 ) |
(QueueKeyStateTable[key] & KS_LOCK_BIT);
}
IntUnLockQueueState;
return ret;
}
int STDCALL ToUnicodeEx( UINT wVirtKey,
UINT wScanCode,
PBYTE lpKeyState,

View file

@ -283,16 +283,6 @@ NtUserGetAltTabInfo(
return 0;
}
DWORD
STDCALL
NtUserGetAsyncKeyState(
DWORD Unknown0)
{
UNIMPLEMENTED
return 0;
}
DWORD
STDCALL
NtUserGetComboBoxInfo(