Is it possible to tell a function NOT to consume an event?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By nineGradens

I’m having trouble with my “Mouse enters area” event never ever triggering.

I SUSPECT it is because some other object is consuming the event- is it possible to tell that object not to.
For example:

func _input()
if(event.button_index==BUTTON_RIGHT):
     Do stuff
     Consume Event
else:
     DON'T consume event. Let other functions list for it.

I’ve tried to get various objects to use “input”, “unhandled_input” etc, but most changes just end up breaking some OTHER part of the program.
Fundamentally, I feel like I need the ability to decide inside a function if that function has handled an event or not…

Do you know which node is consuming that event?

You can choose if a control cares or not about the mouse by changing its mouse mode to Ignore.

Zylann | 2019-08-30 12:44

I’m not entirely sure which control node it is…
but the issue is that all these controls SHOULD be listening to the mouse.

I Need them to notice the mouse, because they are doing important work! I just don’t like the fact now I’ve got a game where no area2d seems capable of detecting mouse enter/exit events.

nineGradens | 2019-08-30 17:29

Annnndddd… solved. (Mainly due to own tinkering, although comment was useful)

Okay, the event system makes perfect sense, I was just misunderstanding it.

nineGradens | 2019-08-30 18:24

@nineGardens can you post your solution?

Eric Ellingson | 2019-08-30 21:30

It would help us if you posted how you solved the problem.

Ertain | 2019-08-31 03:36

:bust_in_silhouette: Reply From: nineGradens

So, problem is solved, and by popular request I will be posting my answer.
I suspect the solution will be not especially helpful, as it mainly reveals my own misconceptions rather than deep programming truth.

Based on my original read of the documentation, and (more importantly) how the the program was acting, I was under the impression that ANY control node would eat ALL inputs into my program:
IE, a control node with an _input() event that I was using to check for keystrokes would just devour all mouse events etc.

What ended up being the issue was that I had a big screen covering “color rectangle”, that I was using to “fade to black”, then the player died. It didn’t have any scripts attached to it, and was literally invisible (hence me ignoring it)… but yeah, that was the thing blocking my mouse events from being detected. The moment I set its mouse mode to Ignore, all was well.

Mostly I was having trouble, because I was trying to solve a problem in the completely wrong place. Ohhh welll.