Page 1 of 1
Event specific pass-through.
Posted: Tue Jun 08, 2010 04:17
by agamemnus
The next version should have an event-specific boolean pass through for all event types, ex:
setMousePassThroughEnabled (bool setting, unsigned integer eventTypeId).
Re: Event specific pass-through.
Posted: Thu Jul 22, 2010 22:34
by agamemnus
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.
Re: Event specific pass-through.
Posted: Fri Jul 23, 2010 16:00
by Jamarr
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.
Re: Event specific pass-through.
Posted: Fri Jul 23, 2010 20:30
by agamemnus
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.
Re: Event specific pass-through.
Posted: Sat Jul 24, 2010 03:53
by agamemnus
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...
Re: Event specific pass-through.
Posted: Sat Jul 24, 2010 07:26
by CrazyEddie
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
Re: Event specific pass-through.
Posted: Sat Jul 24, 2010 12:57
by agamemnus
Cool!
Re: Event specific pass-through.
Posted: Wed Jul 28, 2010 21:10
by agamemnus
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)
