how to test input event in visual script ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By samy
var a1 = event is InputEventScreenTouch
var a2 = event is InputEventScreenDrag
var a3 = event is InputEventMouseButton
var a4 = event is InputEventMouseMotion

Please how to do it on visual script ?

:bust_in_silhouette: Reply From: Elis

Is this what you want?

 func _input(event):
  if (event.type == InputEvent.MOUSE_BUTTON):
    # do something here with the mouse button

Quick read on managing inputs

Thank you sir , what I want is : var a = event is InputEventScreenTouch
in visual script (not in GDscript)
Thank you very much for reply

samy | 2019-03-02 19:50

:bust_in_silhouette: Reply From: samy

Finaly , after getting all methods of event obj , the get_class method is what I needed :

event properties:
Reference
Resource
Resource
resource_local_to_scene
resource_path
resource_name
InputEvent
device
InputEventWithModifiers
alt
shift
control
meta
command
InputEventMouse
button_mask
position
global_position
InputEventMouseMotion
relative
speed
Script
script

event methods:
set_relative
get_relative
set_speed
get_speed
set_button_mask
get_button_mask
set_position
get_position
set_global_position
get_global_position
set_alt
get_alt
set_shift
get_shift
set_control
get_control
set_metakey
get_metakey
set_command
get_command
set_device
get_device
is_action
is_action_pressed
is_action_released
get_action_strength
is_pressed
is_echo
as_text
shortcut_match
is_action_type
xformed_by
_setup_local_to_scene
set_path
take_over_path
get_path
set_name
get_name
get_rid
set_local_to_scene
is_local_to_scene
get_local_scene
setup_local_to_scene
duplicate
init_ref
reference
unreference
free
_notification
_set
_get
_get_property_list
_init
get_class
is_class
set
get
set_indexed
get_indexed
get_property_list
get_method_list
notification
get_instance_id
set_script
get_script
set_meta
get_meta
has_meta
get_meta_list
add_user_signal
has_user_signal
emit_signal
call
call_deferred
set_deferred
callv
has_method
get_signal_list
get_signal_connection_list
get_incoming_connections
connect
disconnect
is_connected
set_block_signals
is_blocking_signals
property_list_changed_notify
set_message_translation
can_translate_messages
tr
is_queued_for_deletion