thanks but this does not work for all cases. I'm using input mapping so that this game will work on windows pc, android, and linux and can use an external controller so when setting up using the key mapping menu. There is no equivalent
func _on_action_pressed(input):
or
func _on_action_released(input):
as far as I know. There is only a method called
Input.is_action_pressed("ui_right")
But I dont know any ways to intercept it. So using this method will make the script really long.