When is the signal Control.input_event supposed to be sent?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Zylann
:warning: Old Version Published before Godot 3 was released.

I need to get events received by a Control, but _input is too low level for my needs, because I have to detect if the mouse is in bounds everytime and perform conversions between screen space and canvas space…

There is a signal input_event on the Control node, but I don’t understand when it is sent. After testing, I still wonder why it is triggered or not.

For example, I listen to the MOUSE_MOTION event, but I receive it only for a sub-region of the Control.

If I listen to MOUSE_BUTTON and use the mouse wheel, I receive it for the whole region.

Any idea what is going on?

:bust_in_silhouette: Reply From: wombatstampede

After some guessing around why my touch events didn’t show in the _input_event() I think that I found it out.

_input_event is sent to Controls when the event is relevant for them (i.e. mouse position is over it). The event contains control-relative coords. So it is kind of locally to the control.
BUT: It doesn’t seem to receive SCREEN_TOUCH + SCREEN_DRAG events.

_input events can also be received by controls but their kind is global. So they have viewport coordinates and if a control decides to receive _input() it also receives events prob. indended for other controls. It has to decide itself what is relevant and what not.

More (and maybe more correct) info is here:

A lot of time passed, now I learned more about events^^
Thank you for your answer :slight_smile:

Zylann | 2017-06-02 00:23