Godot Version
4.3
Question
Hi everyone.
So I’m having issues with the built in input methods _input, _unhandled_input, and _unhandled_key_input.
The issue is the classic key repeat delay when you hold a key (like you’d experiment on any text editor). It goes something like this:
KEY
nothing
nothing
nothing
KEY
KEY
KEY
KEY
KEY
Unfortunately I need to move a character, so that repeat delay is a problem. So here are some points to consider:
-
I’ve tried with all three input methods mentioned above and they all have the same issue.
-
There is no flag I can check for the event parameter (like is_pressed or is_echo) since the method is directly not being called. As you can see in the video below, it doesn’t even execute the print statement, for those few milliseconds the method is not being called.
-
I’ve checked several topics and they mostly say “just use _process with is_action_pressed”. I prefer to have all those inputs inside _unhandled_key_input because I need the input to be checked after all the UI menus, otherwise they might interfere depending on the user key mapping settings
-
Sure, it can be fixed from windows reducing that repeat delay, but as you might have guessed I can’t expect everyone who installs my game to change their accessibility settings.
-
What I can’t find, and this is how maybe you guys can help me, is to find a way, a project setting or maybe another input method that allows me to capture fluid key input so the character moves when the key is down and stops moving when the key is up. But again, I prefer to handle it on some “unhandled_input” event, not in the _process with is_action_pressed (though of course I’ll do it if I have no other option).
Any ideas? Thanks in advance! Here’s a video example of the problem.