I have a simple question, yet I could not find an answer on this forum, sorry if it is redundant.
My problem is, I have a mousePressed event handler and I inject the event into QuickGUI. What I want is: If the mouse press event doesn't touch any QuickGUI widget I want it to do some other stuff on my scene. As I can see the injectMouseButtonDown always returns true.
Is there any way to know if the mouse press was (or can be) handled by QuickGUI?
I have found some rather ugly workaround for my specific case, but please enlighten me on a more normal approach.
virtual bool mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id )
if(mGUIManager->getMouseOverWidget() != mGUIManager->getDefaultSheet())
Why does it always return true? It only returns true if it has fired an event.
My mistake, it always returns false, but that doesn't really help me
bool GUIManager::injectMouseButtonDown(const MouseButtonID& button)
if( !mMouseCursor->isVisible() )
bool eventHandled = false;
mUseMouseTimer = true;
mMouseTimer = 0;
mMouseButtonDown[button] = mWidgetContainingMouse;
return ((mWidgetContainingMouse->getNumberOfHandlers(Widget::EVENT_MOUSE_BUTTON_DOWN) > 0) ||
(mWidgetContainingMouse->getNumberOfHandlers(Widget::EVENT_MOUSE_CLICK) > 0) ||
(mWidgetContainingMouse->getNumberOfHandlers(Widget::EVENT_MOUSE_CLICK_DOUBLE) > 0));
if((mMouseButtonEvents.front() == Widget::EVENT_MOUSE_CLICK) && (mMouseButtonDown[button] != mWidgetContainingMouse))
if(mMouseButtonEvents.front() == Widget::EVENT_MOUSE_CLICK_DOUBLE)
It looks like its commented out from the zip file I uploaded. The SVN version doesn't have this issue, although I'm at work and can't review the code to verify. The intended behavior is to return true only if an event was fired.
Are you able to grab the code from SVN?