_UnhandledInput on a Node is never called

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

As suggested by the InputEvent Documentation, I want to use _UnhandledInput to handle inputs when they are not already handled by the GUI.

My Scene looks like this

Scene Graph

The EditorWorld node implements _UnhandledInput (and callsSetProcessUnhandledInput) but the method is never called even when I don’t click on a visible control.

UI Scene Graph

Implementing _UnhandledInput on other nodes in the tree does not produce any results either.

I set the mouse filter property of all the transparent controls to both Pass and Ignore but the result is the same. The events are all stopped by the UI layer and never fire the _UnhandledInput method on the rest of the nodes.

Here’s a view of the UI scene in the Godot editor. I have added the orange rectangles to show the invisible spacers.

UI Scene Preview

:bust_in_silhouette: Reply From: Laureline David

I managed to solve the issue after more experimentation.

All the “pass through” components and their containers need to have their mouse_filter property set to Ignore.

In the case presented above:

- EditorUI
- EditorUI/Columns
- EditorUI/Columns/Spacer
- EditorUI/Columns/LeftPanel
- EditorUI/Columns/LeftPanel/Stack
- EditorUI/Columns/LeftPanel/Stack/Spacer
- EditorUI/Columns/RightPanel
- EditorUI/Columns/RightPanel/Stack
- EditorUI/Columns/RightPanel/Stack/Control