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:
@@ -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();
|
||||
|
Reference in New Issue
Block a user