Page 1 of 1

Input injection eating input

Posted: Thu Aug 07, 2008 00:55
by dewyatt
I'm having a problem with injectMouseButtonDown().
It's returning true (so CEGUI is handling it) when it shouldn't be.

There are no windows visible, all modal states are false.
Yet it returns true (and thus I don't pass the event on to the game).
It only happens the first time during app run, never again.

Can you think of any reason it would return true, despite the fact that no windows are visible/modal?

Posted: Thu Aug 07, 2008 09:25
by CrazyEddie
Hi,

I suspect a root window is not hidden (obviously you can't see it, as it's invisible). Something like:

Code: Select all

CEGUI::Window* root =
    CEGUI::System::getSingleton().getGUISheet();

if ( root && root->isVisible())
{
    initiateSelfDestruct();
}


would confirm.

HTH

CE.

Posted: Thu Aug 07, 2008 14:34
by dewyatt
Darn! I thought that would be it, but I don't think so.

Test code:

Code: Select all

//switch (EventType)
//case MouseButtonDown:
printf("GUI::MouseButtonDown\n");
if (NULL != mSystem->getGUISheet())
{
   printf("GUISheet exists\n");
   if (mSystem->getGUISheet()->isVisible())
      printf("GUISheet is visible\n");
}
if (mSystem->injectMouseButtonDown(Button))
{
   printf("***Handled MouseButtonDown***\n");
   return true;
}
else
{
   return false;
}

It prints:
GUI::MouseButtonDown
GUISheet exists
***Handled MouseButtonDown***


So the GUISheet exists but is not visible, yet it's receiving input.
For now I think I'll try to just setGUISheet(NULL) when nothing is visible.

Posted: Thu Aug 07, 2008 18:58
by CrazyEddie
In that case, it sounds like a bug: http://www.cegui.org.uk/mantis/view.php?id=226

Thanks :D

CE.