InputEventKey broken?

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

Am I not doing something right or is this thing broken.
Hire’s the thing, after this code when i press key i get minimum 2 values. After some tests i think one is on key down and other on key up. I get a filling that this is not intended and if so can some one report this, I have no idea how reporting bugs and stuff works hire :confused:
And if not please correct me how do i get one value from one press.

func _input(event):
if event is InputEventKey:
print(event.scancode)

:bust_in_silhouette: Reply From: kidscancode

This is correct. Pressing and releasing are both events, and you are capturing both of them.

If you only want to capture the press event, you can check the event’s pressed property.

func _input(event):
if event is InputEventKey and event.pressed:
print(event.scancode)

Further information: