Input in a windowed environment

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

First let me say that not everyone is writing platformers. Unfortunately all examples available online seem to be about platformers or similar games.

I am writing a desktop application in Godot 4.0 and there can be several windows open at the same time.

My issue is with input. Whenever a window is in focus no other nodes except those below it can receive input information. Even if there is no _input() or _unhandled_input() anywhere within the sub-tree below the window, no other part of the application will receive any input.

Ideally I would like some global keystrokes to be monitored at the application level and some other input to be available in some of the windows. There is currently no way of doing that. If I query input during the course of a frame, whatever key the user is pressing is repeated multiple times. And it is also not an efficient want to monitor user input unless you are writing a shoot-em-up game. If I start fiddling with delta times to see how long a key has been pressed, we enter a nightmare scebario.,

Has anyone encountered this input issue in a multi-windowed environment?

I’m having the same problem. I’m trying to make a transport-tycoon style game, but windows eat up all input events, so that _input doesn’t receive them anymore. In practice, that means that I can’t move the camera around when a window is open. Have you found a solution for this?

Jan Heemstra | 2023-04-09 14:54

Unfortunately not and I am wondering if it should be raised as a bug…

JG | 2023-04-09 18:20