How to forward keyboard input to sub-viewport?

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

Is there a way to forward the keyboard input to sub-viewports? According to the documentation, this should happen automatically but it does not work for me. It would be nice if one could call _input(event) on specific nodes explicitly. However, this does not seem to be intended.

Context: I would like to have a TextEdit (in a sub-viewport) as texture in the parent 3D scene. Btw, calling grab_focus() in the sub-viewport also does not lead to getting input events.

Thanks for suggestions.

:bust_in_silhouette: Reply From: meigel

Ok, I missed that Viewport.input(event) can be called which solves this issue for me. Nevertheless, at least when Viewport is set as render target, it won’t receive input events automatically.