Input injection eating input

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

dewyatt
Not too shy to talk
Not too shy to talk
Posts: 28
Joined: Sat Jun 14, 2008 21:26

Input injection eating input

Postby dewyatt » Thu Aug 07, 2008 00:55

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?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Thu Aug 07, 2008 09:25

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.

dewyatt
Not too shy to talk
Not too shy to talk
Posts: 28
Joined: Sat Jun 14, 2008 21:26

Postby dewyatt » Thu Aug 07, 2008 14:34

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.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Thu Aug 07, 2008 18:58

In that case, it sounds like a bug: http://www.cegui.org.uk/mantis/view.php?id=226

Thanks :D

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 12 guests