how control a object with multiple keys?

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

I have problems with the combination of keys to control some actions in my player, i want do this: with the key “p” not move and after with up or down move the player and other object, my program not move nothing.

I need help with the code:

			if event is InputEventKey:
			if  event.is_pressed() and event.scancode == KEY_P:

				move=false
				if event.is_action_pressed("ui_down"):
	               obj.transform.origin.z+=6
	               self.transform.origin.z+=1
				if event.is_action_pressed("ui_up"):
	               obj.transform.origin.z-=6
	               self.transform.origin.z-=1		
			if  !event.is_pressed() and event.scancode == KEY_P:
				move=true
:bust_in_silhouette: Reply From: Inces

First thing : scancode is not a string. Scancode is integer, that You can use as argument for OS.get_scancode_string to geto your keyboar key name. Or You can bind P key to action in Editors Input Map.