Can SCREEN_TOUCH and DRAG be checked outside _input()?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By D
:warning: Old Version Published before Godot 3 was released.

I have a project that I need to check for SCREEN_TOUCH or DRAG state outside of the _input() function. Can’t find a way to do it. Any help is appreciated.

:bust_in_silhouette: Reply From: bruteforce

I never used the SCREEN_TOUCH stuff, but why don’t you create a variable to store that event?
Just create a member variable, and set it up inside the _input function, then use it wherever you want!

For example:

var touchEvent
(...)
func _input(event):
	if(event.type == InputEvent.SCREEN_TOUCH):
		touchEvent = event
		
func anotherFunc():
	print(touchEvent)
(...)