Know if CEGUI handled key/mouse input

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
zola
Quite a regular
Quite a regular
Posts: 48
Joined: Wed Jan 12, 2005 12:06

Know if CEGUI handled key/mouse input

Postby zola » Tue Oct 12, 2004 22:34

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

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

Know if CEGUI handled key/mouse input

Postby CrazyEddie » Wed Oct 13, 2004 05:01

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

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

Know if CEGUI handled key/mouse input

Postby CrazyEddie » Wed Oct 13, 2004 09:04

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.

User avatar
zola
Quite a regular
Quite a regular
Posts: 48
Joined: Wed Jan 12, 2005 12:06

Know if CEGUI handled key/mouse input

Postby zola » Wed Oct 13, 2004 13:41

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

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

Know if CEGUI handled key/mouse input

Postby CrazyEddie » Wed Oct 13, 2004 17:58

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.

User avatar
zola
Quite a regular
Quite a regular
Posts: 48
Joined: Wed Jan 12, 2005 12:06

Know if CEGUI handled key/mouse input

Postby zola » Fri Oct 15, 2004 09:19

: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.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 5 guests