+1 vote

I have the following node tree where my spatial is a packed scene. node tree

I have static bodies in my scene with the following code.

func _input_event(camera, event, click_position, click_normal, shape_idx):
    if event is InputEventMouseButton and event.button_index == BUTTON_LEFT:
        print("clicked %s" % self)

In order for this to work the mouse input must be unhandled. By default the HSplitContainer will handle any mouse button inputs. I can set the mouse filter to ignore on the HSplitContainer but then I can no longer resize the HSplitContainer since I can't click on the grabber.

If there's a way to explicitly set an event as unhandled I can't find it.

How can I get unhandled mouse inputs inside of my spatial without ignoring mouse events for HSplitContainer?

Godot version 3.2.2
in Engine by (58 points)

1 Answer

+1 vote
Best answer

There is a SceneTree.set_input_as_handled() but no reverse function.

If you override _input(event), it should not matter whether or not the input is marked as handled, only for _unhandled_input(event) or _gui_input(event).

If you really need to, you could set up a "bridge". Detect the input in a script inside your Node named Node, then transfer the information down to your Spatial.

by (2,482 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.