Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | acambule |
Hi there,
I’ve got a TitleScreen (Controller) scene with an gui_input Signal. The handling looks like this:
func _on_TitleScreen_gui_input(event):
GLOBAL.debug_InputEvent("_gui_input: ",event)
in global.md:
func debug_InputEvent(aMessage, event):
var eventStr
if event is InputEventKey: eventStr = "InputEventKey"
elif event is InputEventMouseButton: eventStr = "InputEventMouseButton"
#elif event is InputEventMouseMotion: eventStr = "InputEventMouseMotion"
elif event is InputEventJoypadMotion: eventStr = "InputEventJoypadMotion"
elif event is InputEventJoypadButton: eventStr = "InputEventJoypadButton"
elif event is InputEventScreenTouch: eventStr = "InputEventScreenTouch"
elif event is InputEventScreenDrag: eventStr = "InputEventScreenDrag"
elif event is InputEventAction: eventStr = "InputEventAction"
elif event is InputEvent: eventStr = "Unhandled InputEvent"
print(aMessage + eventStr)
I would expect when i hit the escape key that i get a print out of InputEventKey or InputEventAction, instead its always Unhandled, because of commented out mousemotion.
How do i catch a keystroke?