Add Input `is_anything_pressed` method
Your typical "Press any key" use case using the Input
singleton, can also be used to conveniently detect and switch various idle
states, such as character switching to bored
state if you wish so.
func _physics_process(_delta):
if Input.is_anything_pressed():
$message.text = "Thanks!"
There's another way for doing so using _input
:
func _input(event):
if event.is_pressed():
$message.text = "Thanks!"
But it might not be possible to achieve in the future according to:
In any case, I'm here to tell that it might be a good idea to leave InputEvent.is_pressed()
as is.