About Viewport.set_input_as_handled()

Godot Version

4.2.1

Question

I have bit weird question about Viewport.set_input_as_handled(). From where set_input_as_handled know what exact event have to be set as handled . How i can set specific event as handled and another keep not handled ? Is it thread safe ?

You use it with the current input event in _input etc., see the documentation: Using InputEvent — Godot Engine (stable) documentation in English

1 Like

Hi. Thanks for reply. But i asked completely another question.

No that’s the entire way that works, you can’t set some random event as handled, that’s not how it works :slight_smile: so see how it does work :slight_smile: And you asked “From where set_input_as_handled know what exact event have to be set as handled” and I answered that :slight_smile:

Only one event at a time is either handled or not handled, the event that is currently being processed, events that haven’t happened yet can’t be handled already, and events from the past can’t be set as handled either

Only one extra question what happens with unhanded events which were generated and not handled by any node.

They end up in the _unhandled_input method, as you can see in the link I sent :slight_smile: Otherwise nothing happens to them