Topic was automatically imported from the old Question2Answer platform.
Asked By
CensedPie
I want to be able to show different controls on the UI depending whether the player pressed on the keyboard or the controller, not just if he has the controller connected. Is there a method of some class like Input that would tell me whether the input came from a controller or keyboard?
I just got started with Godot, so there might be better ways, but I believe you can use…
func _input(event)
if(event is InputEventKey):
# Do stuff
elif(event is InputEventJoypadButton):
# Do stuff
elif(event is InputMouseButton):
# Do stuff
elif(event is InputEventScreenTouch):
# Do stuff
else:
# Do stuff