Added wxGetMouseState which returns the current state of the mouse.

Returns an instance of a wxMouseState object that contains the current
position of the mouse pointer in screen coordinants, as well as
boolean values indicating the up/down status of the mouse buttons and
the modifier keys.  Implemented for wxMSW, wxGTK and wxMac.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36691 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2006-01-05 04:31:27 +00:00
parent 18a1de69aa
commit 7dd40b6f4b
7 changed files with 210 additions and 0 deletions

View File

@@ -5390,6 +5390,28 @@ bool wxGetKeyState(wxKeyCode key)
#endif
}
wxMouseState wxGetMouseState()
{
wxMouseState ms;
POINT pt;
GetCursorPos( &pt );
ms.SetX(pt.x);
ms.SetY(pt.y);
ms.SetLeftDown( (GetAsyncKeyState(VK_LBUTTON) & (1<<15)) != 0 );
ms.SetMiddleDown( (GetAsyncKeyState(VK_MBUTTON) & (1<<15)) != 0 );
ms.SetRightDown( (GetAsyncKeyState(VK_RBUTTON) & (1<<15)) != 0 );
ms.SetControlDown( (GetAsyncKeyState(VK_CONTROL) & (1<<15)) != 0 );
ms.SetShiftDown( (GetAsyncKeyState(VK_SHIFT) & (1<<15)) != 0 );
ms.SetAltDown( (GetAsyncKeyState(VK_MENU) & (1<<15)) != 0 );
// ms.SetMetaDown();
return ms;
}
wxWindow *wxGetActiveWindow()
{
HWND hWnd = GetActiveWindow();