Check multiple inputs

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

Since mapping Joystick Axis & DPad Axis inputs cause issues I’ve to check them separatly…
So how to check multiple lines like that…

elif Input.is_action_pressed("INPUT_KeyUp"):
or Input.is_action_pressed("INPUT_LeftJoystickUp"):
or Input.is_action_pressed("INPUT_DpadUp"):
do the stuf...
:bust_in_silhouette: Reply From: jgodfrey

If you’re just asking about the syntax of the above, on one line it’d look like:

if Input.is_action_pressed("ui_up") or Input.is_action_pressed("ui_down") or Input.is_action_pressed("ui_cancel"):
	print("hi")	

But, since that can get hard to read, you can break it up into manageable chunks by wrapping the lines as long as you end each wrapped line with \, like:

if Input.is_action_pressed("ui_up") or \
	Input.is_action_pressed("ui_down") or \
	Input.is_action_pressed("ui_cancel"):
		print("hi")