X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/339039581a65cc39729a10eb808598d06c02a4d7..63e819f2981585279fe8a06629f69b7002eee9dc:/src/mgl/utils.cpp diff --git a/src/mgl/utils.cpp b/src/mgl/utils.cpp index c20c5db3ef..c6dad8291a 100644 --- a/src/mgl/utils.cpp +++ b/src/mgl/utils.cpp @@ -165,6 +165,28 @@ wxPoint wxGetMousePosition() return pt; } +wxMouseState wxGetMouseState() +{ + wxMouseState ms; + int x, y; + + wxGetMousePosition(&x, &y); + + ms.SetX(x); + ms.SetY(y); + + extern unsigned long g_buttonState; + ms.SetLeftDown(g_buttonState & EVT_LEFTBUT); + ms.SetMiddleDown(g_buttonState & EVT_MIDDLEBUT); + ms.SetRightDown(g_buttonState & EVT_RIGHTBUT); + + ms.SetControlDown(EVT_isKeyDown(KB_leftCtrl) || EVT_isKeyDown(KB_rightCtrl)); + ms.SetShiftDown(EVT_isKeyDown(KB_leftShift) || EVT_isKeyDown(KB_rightShift)); + ms.SetAltDown(EVT_isKeyDown(KB_leftAlt)); + ms.SetMetaDown(EVT_isKeyDown(KB_rightAlt)); + + return ms; +} #ifdef __UNIX__