I just want to ask if I get this right and is my information up to date.
I’m handling menu controls (like press esc to go back) through _UnhandledKeyInput. It works as expected for keyboard, but not for gamepad. According to documentation this is expected, because gamepad doesn’t raise input events.
Apparently you can go around it but you have to go through a lot of hoops, or just not use any form of _Input and just use _Process instead (using things like Input.IsActionJustPressed). So I want to make sure that I get this right before I start to remove all _UnhandledKeyInput from my code.
You’ve already realized that_UnhandledKeyInputdoes not work with Gamepad/Mouse. You could just test the other options before completely rewriting your code.
Imho, the simplest option is to just use _UnhandledInputinstead (or _Input, depending on your setup). For me, this recognizes mouse and gamepad as well. No need to change toProcess.
I’ve checked _Input after seeing your comment, and to my surprise it works. Which contradicts information from documentation. Allow me to quote it:
Unlike keyboard input, holding down a controller button such as a D-pad direction will not generate repeated input events at fixed intervals (also known as “echo” events). This is because the operating system never sends “echo” events for controller input in the first place.
If you want controller buttons to send echo events, you will have to generate InputEvent objects by code and parse them using Input.parse_input_event() at regular intervals. This can be accomplished with the help of a Timer node.
This is the reason why I’ve asked the question - I wanted to know if I’m up to date on current state of things before pulling out the big guns.
As for reasoning why I’ve used _UnhandledKeyInput - _Input also catches mouse movement, and I don’t care about it in “navigate menu through buttons” context. But if it also catches gamepad, then it’s much more useful than _UnhandledKeyInput.
I think you might have misunderstood what this is about - this does not state that pressing a controller button will not be recognized as an input, but instead it explains how holding down buttons (keeping them pressed) interacts with the engine.
This is a good thought - tbh I did not look into this method before. But yes, if you need gamepad support, you still need to use e.g. _UnhandledInput