X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/224016a800a9939332cb87401304c476fefe6664..bcd846ea7191d33d86e28ee1927b461c54d2fb8f:/src/gtk/window.cpp diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 1e9038e20a..d27d7d642b 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2672,6 +2672,31 @@ wxWindow *wxGetActiveWindow() return wxWindow::FindFocus(); } + +wxMouseState wxGetMouseState() +{ + wxMouseState ms; + + gint x; + gint y; + GdkModifierType mask; + + gdk_window_get_pointer(NULL, &x, &y, &mask); + + ms.SetX(x); + ms.SetY(y); + ms.SetLeftDown(mask & GDK_BUTTON1_MASK); + ms.SetMiddleDown(mask & GDK_BUTTON2_MASK); + ms.SetRightDown(mask & GDK_BUTTON3_MASK); + + ms.SetControlDown(mask & GDK_CONTROL_MASK); + ms.SetShiftDown(mask & GDK_SHIFT_MASK); + ms.SetAltDown(mask & GDK_MOD1_MASK); + ms.SetMetaDown(mask & GDK_MOD2_MASK); + + return ms; +} + //----------------------------------------------------------------------------- // wxWindowGTK //-----------------------------------------------------------------------------