_input_event(event) doesn't reconize InputType.SCREEN_TOUCH

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

I have this hierarchy:
gamepad → HBoxContainer (root)
-joystick_space → CenterContainer
-joystick → TextureFrame (Script here “Joystick.gd”)

i am emulating a analog joystick for a platform game and i test on the editor emulating touchscreen (This is enabled in project settings), suddenly, my code stop working, so i print event.type to see what is going on and i see the value is 2 (That value is for mouse motion) and 3 (mouse touch), but value 7 and 6 doesn’t appear anymore. I started the project again from scratch but the problems continue. For some reason in collision objects _input_event can handle screen touch. I enable _unhandle_input(event) and here the screen touch appears, but this doesn’t work for me. I need to handle the event in _input_event. Each node have ignore_mouse = false, and stop_mouse = true. And i test every combination and nothing. I just have in the code this:

_ready():
   set_process_input(true)
   set_process_unhandled_input(true)

 func _input(event):
    print (event.type)  #screen touch doesn't appears

 func _input_event (event):
    print(event.type) #screen touch doesn't appear. But when a started the project, it do

 func _unhandled_input(event):
    print (event.type) # screen touch appears. But here doesn't works for me

Sorry the english.

looks like this
Control Node sends wrong events · Issue #9981 · godotengine/godot · GitHub

it got fixed for 3 but not for 2.

eons | 2018-02-04 20:44

Thank you! So, I will use unhandle_input. :frowning:

JordanMotta | 2018-02-04 23:29