Event specific pass-through.

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

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Event specific pass-through.

Postby agamemnus » Tue Jun 08, 2010 04:17

The next version should have an event-specific boolean pass through for all event types, ex:

setMousePassThroughEnabled (bool setting, unsigned integer eventTypeId).

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: Event specific pass-through.

Postby agamemnus » Thu Jul 22, 2010 22:34

Here is an example of why this is important.

My game uses the middle mouse button (scroll wheel) to zoom in and out. I want to make an event-function for the entire area of a window that will deactivate the global scroll wheel trigger. (thus turning off the zoom in/out) This is useful for windows that have potentially some scrollable content: I don't want to both scroll and zoom in/out at the same time!

Unfortunately I seemingly cannot do this.

I have to set the scroll wheel event-function for every single sub-window in my window. This gets extremely tedious.

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

Re: Event specific pass-through.

Postby Jamarr » Fri Jul 23, 2010 16:00

Why don't you just subscribe to the global scroll event, use CEGUI::System::getWindowContainingMouse and then Window::isPropertyPresent to check for ScrollPosition, or some other relevant property, or even a custom property, to determine if the scroll should be local or global; or instead of properties, you could check for a specific type of window, or name, etc. there are many possibilities.
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!

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: Event specific pass-through.

Postby agamemnus » Fri Jul 23, 2010 20:30

It appears that CEGUI::System::getWindowContainingMouse is similarly limited... As far as I can tell, I can't check for a specific window; I have to specify both it and all its children to check for the mouse being in that window's area...

At the moment I just turn off map scrolling whenever the mouse is in *any* window except root, but that's not really the ideal.

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: Event specific pass-through.

Postby agamemnus » Sat Jul 24, 2010 03:53

Hmm...

Another thing that would be useful is an EventElsewhere() :

Normally, you would do something like 'cegui.subscribeEvent (window, "MouseClick", ...'
I have come upon the need to add an event that's the opposite: ie, it would fire when there's a mouseclick SOMEWHERE ELSE...

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

Re: Event specific pass-through.

Postby CrazyEddie » Sat Jul 24, 2010 07:26

If you're on svn / snapshot code, you might also look at the recently added mouse event propagation setting for window: Window::setMouseInputPropagationEnabled, which passes unhandled mouse inputs back up the window hierarchy.

CE

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: Event specific pass-through.

Postby agamemnus » Sat Jul 24, 2010 12:57

Cool!

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: Event specific pass-through.

Postby agamemnus » Wed Jul 28, 2010 21:10

The same fundamental problem of having to use setMouseInputPropagationEnabled on every child window remains.

It would be more useful to be able to set it the other way around, either with:

*one new command that would tell the window's current and future children to use setMouseInputPropagationEnabled
*or*
distributesCapturedInputs () with a parameter for which input to distribute.
*or*
setMousePassThroughEnabled (bool setting, unsigned integer eventTypeId) :D


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 7 guests