![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | blohod |
I have a StaticBody2d that i want to detect when i press a key while moused over it. I am able to use _input_event()
to detect mouse clicks but it does not seem to work for key presses. Ideally I want to detect an InputEventAction
.
This works for mouse clicks, but no key press events are printed.
func _input_event(viewport, event, shape_idx):
print(event)
if event is InputEventMouseButton :
if event.button_index == BUTTON_LEFT and event.is_pressed():
emit_signal("interact", self, tool_needed)
print("goo")