X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b2e178485a2efcc04c88fa107b354a3e14454991..63e819f2981585279fe8a06629f69b7002eee9dc:/src/mgl/utils.cpp diff --git a/src/mgl/utils.cpp b/src/mgl/utils.cpp index 503914f8a2..c6dad8291a 100644 --- a/src/mgl/utils.cpp +++ b/src/mgl/utils.cpp @@ -168,7 +168,23 @@ wxPoint wxGetMousePosition() wxMouseState wxGetMouseState() { wxMouseState ms; - // TODO + 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; }