Knowing an event has been used?
When I push an event, say a mouse click in to Noesis how do I know if that event has been consumed (for example used by a button). I need to know if a click should be sent to the "game" underneath the UI layer.
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: Knowing an event has been used?
As indicated in IView comments, all input events injected to the view return a bool that indicate if the event has been handled by the UI.
You can also use VisualTreeHelper::HitTest() to determine if mouse is over any UI element, sometimes that is also useful.
Code: Select all
/// Notifies that a mouse button was pressed. Origin is in the upper-left corner.
/// Returns true if event was handled
virtual bool MouseButtonDown(int x, int y, MouseButton button) = 0;
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: Knowing an event has been used?
You're welcome, marking this as solved.
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 13 guests