How to tell when mouse is in GUI

Captain_Deathbeard

29-08-2008 00:32:57

A simple question, but I can't figure the answer. How can I easily tell if the mouse is over a window or not? Not just a single window, but any element of the GUI at all. (Because obviously I dont want it to un-select all my units when I click on a button).

In RBGgui I just used a function like "findWindowAtPoint(mousePos)", but I can't find a similar function

I thought to use a mouseMoved event on the Window, and use that to set a flag, but it doesn't register when the mouse is over a widget within that window. And I don't want to have to add that event to every single little widget I create.

my.name

29-08-2008 01:30:09

MyGUI::InputManager::getInstance().getMouseFocusWidget();

Altren

06-09-2008 16:30:24

All injectors return boolean value if event was handled by GUI, so you can write something likeif ( mGUI->injectMouseMove(arg) )
{
// mouse over GUI
}
else
{
// mouse not over GUI
}