Page 1 of 1

Know if CEGUI handled key/mouse input

Posted: Tue Oct 12, 2004 22:34
by zola
hi
how can i find out if CEGUI handled key and mouse input?
if i inject the event using System.injectXYZ i alway get true as an answer even if i click on a space on the screen where no window is.


thanks
z

Know if CEGUI handled key/mouse input

Posted: Wed Oct 13, 2004 05:01
by CrazyEddie
This is a bug in the processing of MouseButtonDown events for the left mouse button; as far as I know everything else whould work okay. I'll fix this bug today :)

CE

Know if CEGUI handled key/mouse input

Posted: Wed Oct 13, 2004 09:04
by CrazyEddie
Okay, this was not actually the bug I thought it was :)

I think the problem is being caused by the fact that your root window is consuming the input and flagging it as handled. When the mouse is not within any window, the input will always gets sent to the root window (there are many reasons for this). The solution is to make use of the DefaultGUISheet (now known as DefaultWindow), and use this as the root, adding your other windows to it. DefautlWindow does not consume inputs and therefore you'll get the behaviour you expect.

HTH

CE.

Know if CEGUI handled key/mouse input

Posted: Wed Oct 13, 2004 13:41
by zola
Hi

Thanks for the tip.

Maybe I'm using the windows in a wrong way?
On application start I create a root window of the type "DefaultGUISheet" and set this with system.setGUISheet(myroot);
Then I load all my menus (defined in xmls) and make them children of "myroot". To Switch between menus I enable/disable the specific window and set the visibility. maybe this is wrong and i should instead switch the GUISheet between menus?

Anyway the strange thing is I do not handle any events fired by the root window. I only handle events in the child windows i load via xml.

*shrug*, I'll post a repost when I found what I'm doing wrong :)

Thanks
Tom

Know if CEGUI handled key/mouse input

Posted: Wed Oct 13, 2004 17:58
by CrazyEddie
Hmmm, that's very odd then :? I did a small test before my earlier post, and had a frame window attached to a DefaultGUISheet which was set as root. Any mouse event not within the frame window was correctly returned as non handled.

Key inputs are slightly different, as they go to the 'active' window, so for these to be reported as unhandled, you'd need to detect when the mouse leaves your Gui area, and deactivate some appropriate windows.

Let me know what happens next :)

CE.

Know if CEGUI handled key/mouse input

Posted: Fri Oct 15, 2004 09:19
by zola
:D as I thought, it's completely my fault.

I have made some test and therefore added between my root DefautlGUISheet and the menus a frameless window with no titlebar that covered the whole screen. in the window i was monitoring every mouse and key input and returned an each event 'true' which is false :lol:

anyway thanks for the help.