grab focus() on label

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

why does this code not work on a label?

 if Input.is_action_just_pressed("ui_accept"):

And how do I write about it when I have focus?

:bust_in_silhouette: Reply From: Andrea

where is that piece of code located?
have you tried with

func _input(event):
 if event.is_action_pressed("ui_accept"):