Do I need to return some value when I process an input event?

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

For example:

func _unhandled_input( event ):
	if( event.index == 0 ):
		if( event.type == InputEvent.SCREEN_TOUCH ):
			if( event.pressed ):
				# DO STUFF
				return true
		elif( event.type == InputEvent.SCREEN_DRAG ): )
				# DO STUFF
				return true

	# If it got here, no event got processed, pass it on ??

Or does Godot “knows” when an event gets processed automatically? Am I on the right track?

:bust_in_silhouette: Reply From: hilfazer

Call get_tree().set_input_as_handled() to stop it from propagating.

More info here: InputEvent — Godot Engine (3.0) documentation in English