Consuming touch events (ofxUI)

Is it possible to consume a touch event, so that it will not be delivered to other recipients?

A more concrete example is having some ofxUI controls on top of a canvas where it is possible to draw on.
The problem is that the touch does not get consumed when pressing on the UI controls resulting in drawing under the UI components, for example when dragging a slider.

Do I need to create my own setup to check if a UI control was pressed before drawing on the canvas?
Are there any guaranties regarding the order in which the events are sent?
New to OF so not sure what is the best way to do this.

I found a similar issue here:
overlapping drop down menus conflict

Is there really no way to handle touches on overlapping surfaces?

Is there no way to extract the current screen position of the UI (or draw the UI on a specific screen location)?
Then you can tell the touch event handler to ignore everything around that position.

A different solution could be to use a keyboard shortcut to show / hide the GUI. If the GUI is enabled (visible), then disable touch event handling.

I need the UI to be dynamic and not restricted to only one part of the screen. For example tabs that open/close other widgets, maybe even be able to drag the widgets around.

It should be possible to check where exactly the UI components are on screen, but that is what I was trying to avoid. I would have to go through all visible components and check if the touch is within the bounds.

The main target of the app will be iPad so can’t use keyboard shortcuts and this would also require an extra step (show/hide UI).

I think it’s quite common for UI systems to have some kind of event propagation, allowing to stop the event reaching obscured components.