Page 1 of 1

CEGUI is intercepting all mouse clicks

Posted: Mon Jun 27, 2011 12:23
by rogerdv
Im having a problem with cegu on my project, seems that it is processing all mouse clicks. This is my mouse pressed event:

Code: Select all

bool StratApp::mousePressed (const OIS::MouseEvent &arg, OIS::MouseButtonID id)
{

   if (CEGUI::System::getSingleton().injectMouseButtonDown(convertOGREButtonToCEGUI(id)))
            return true;
  * * *
}

This is my layout file:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<GUILayout >
    <Window Type="DefaultWindow" Name="Root" >
        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
        <Window Type="OgreTray/Button" Name="Root/btNew" >
            <Property Name="Font" Value="DejaVuSans-10" />
            <Property Name="Text" Value="New" />
            <Property Name="UnifiedAreaRect" Value="{{0.00898439,0},{0.0102427,0},{0.0617188,0},{0.0486516,0}}" />
        </Window>
        <Window Type="OgreTray/Button" Name="Root/btLoad" >
            <Property Name="Font" Value="DejaVuSans-10" />
            <Property Name="Text" Value="Load" />
            <Property Name="UnifiedAreaRect" Value="{{0.0707031,0},{0.0103775,0},{0.123438,0},{0.0487865,0}}" />
        </Window>       
    </Window>
</GUILayout>


I copied the code from a previous project, where it works perfectly. But here it always returns without letting the rest of the code to be executed. Any idea?

Re: CEGUI is intercepting all mouse clicks

Posted: Mon Jun 27, 2011 16:29
by Kulik
Enable the mouse pass through for the root window. The root window takes the whole screen and "eats" all the click events. If it has mouse event pass through enabled, it won't consume the events.