MousePassThroughEnabled Property

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

User avatar
hadesfury
Just popping in
Just popping in
Posts: 10
Joined: Mon Nov 23, 2009 13:31

MousePassThroughEnabled Property

Postby hadesfury » Mon Nov 23, 2009 13:39

Hello,

I had a problem to figure why my click didn't pass through the DefaultWindow ... and finally found the MousePassThroughEnabled Property on your forum

I write a little post because there is some strange behavior that drive me toward bad conclusion.

When the MousePassThroughEnabled Property is disable, I can make the click Pass Through by double clicking ... and I really wonder why it's working

So my problem is fixed until the next one :D but I wanted to warn you about that if you are not aware of it

Best regards

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: MousePassThroughEnabled Property

Postby Jamarr » Mon Nov 23, 2009 17:13

You did not tell us what version of CEGUI you are running?
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

User avatar
hadesfury
Just popping in
Just popping in
Posts: 10
Joined: Mon Nov 23, 2009 13:31

Re: MousePassThroughEnabled Property

Postby hadesfury » Mon Nov 23, 2009 17:46

I was on the svn souce trunk version (it did it ) ... then test the Svn 0.7 ( so I suppose it is the 0.7.1 :D ) and it did it too

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

Re: MousePassThroughEnabled Property

Postby CrazyEddie » Thu Dec 03, 2009 10:18

Not sure why this should happen, but thanks for the report. I will test it out.

CE.

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

Re: MousePassThroughEnabled Property

Postby CrazyEddie » Mon Dec 07, 2009 09:32

I've tried to reproduce this issue without success :?

What I did was to create a FrameWindow and subscribe a handler to hear about the mouse button events, then I covered this with a DefaultWindow with mouse pass through disabled, and had at it - clicking away above the frame window - but no events were ever fired.

If you could post a minimal code or XML layout example that we can use to reproduce the issue, that would be most appreciated.

Thanks,

CE.

User avatar
hadesfury
Just popping in
Just popping in
Posts: 10
Joined: Mon Nov 23, 2009 13:31

Re: MousePassThroughEnabled Property

Postby hadesfury » Tue Mar 23, 2010 12:33

Sorry about the time between your request ... without the MousePassThroughEnabled Property

so this is my layout

Code: Select all

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

<GUILayout >
    <Window Type="DefaultWindow" Name="editor_mode" >
        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
        <Window Type="TaharezLook/Button" Name="add_button" >
            <Property Name="Text" Value="Add" />
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="UnifiedAreaRect" Value="{{0.01,0},{0.95,0},{0.10,0},{1,0}}" />
        </Window>
        <Window Type="TaharezLook/Button" Name="save_button" >
            <Property Name="Text" Value="Save" />
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="UnifiedAreaRect" Value="{{0.11,0},{0.95,0},{0.20,0},{1,0}}" />
        </Window>
        <Window Type="TaharezLook/Button" Name="delete_button" >
            <Property Name="Text" Value="Delete" />
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="UnifiedAreaRect" Value="{{0.21,0},{0.95,0},{0.30,0},{1,0}}" />
        </Window>
        <Window Type="TaharezLook/Button" Name="layer_button" >
            <Property Name="Text" Value="Layer" />
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="UnifiedAreaRect" Value="{{0.31,0},{0.95,0},{0.40,0},{1,0}}" />
        </Window>
        <Window Type="TaharezLook/Button" Name="level_button" >
            <Property Name="Text" Value="Level" />
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="UnifiedAreaRect" Value="{{0.41,0},{0.95,0},{0.50,0},{1,0}}" />
        </Window>
        <Window Type="TaharezLook/StaticText" Name="debug_info" >
            <Property Name="Text" Value="Debug Info :" />
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="UnifiedAreaRect" Value="{{0.0,0},{0.0,30},{1.0,0},{0.1,0}}" />
            <Window Type="TaharezLook/StaticText" Name="debug_info_text" >
                <Property Name="Text" Value="" />
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.15,0},{0.1,0},{1.0,0},{0.9,0}}" />
            </Window>
        </Window>
       
    </Window>
</GUILayout>


this is the code that link between input and CEGUI

when I single click it always return true but when I double click it return false the second time

Code: Select all

Bool ManagerGui::MousePressed(
    const OIS::MouseState & mouse_event,
    OIS::MouseButtonID mouse_button_id
    )
{
    CEGUI::MouseButton
        mouse_button;

    if ( mouse_button_id == OIS::MB_Left )
    {
        Bool
            has_input_been_injected = False;

        mouse_button = CEGUI::LeftButton;

        has_input_been_injected = CEGUI::System::getSingleton().injectMouseButtonDown( mouse_button );

        return has_input_been_injected;
    }

    return False;
}

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

Re: MousePassThroughEnabled Property

Postby CrazyEddie » Tue Mar 23, 2010 15:20

Ah, right. I think there was some misunderstanding previously as regards to how we interpret 'pass through'. For our usage of the term in general, we mean that the mouse can pass through to CEGUI content beneath; it should not be thought of in the context of passing through to the underlying playfield or scene.

Basically, if that root window 'editor_mode' is set as the GUI sheet window, then to get reliable return results from the inject functions you must set the MousePassThroughEnabled property to True on that root window. If you do not do this, all kinds of strange behaviour will occur - such as what you experienced ;)

CE.

User avatar
hadesfury
Just popping in
Just popping in
Posts: 10
Joined: Mon Nov 23, 2009 13:31

Re: MousePassThroughEnabled Property

Postby hadesfury » Tue Mar 23, 2010 15:33

Yes I've done that ( setting MousePassThroughEnabled to True ) and it works very well ... I just told it if it could help you as soon as I was thinking that it was a bug ;)

Best regards ;)


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 11 guests