0 votes
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 ?

asked Mar 2, 2019 in Projects by samy (21 points)
edited Mar 2, 2019 by samy

2 Answers

0 votes
Best answer

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

https://drive.google.com/open?id=1ak_IP3cXbnLVah3bo_Yf9BGyxgQqHRTX
event properties:
Reference
Resource
Resource
resource
localtoscene
resourcepath
resource
name
InputEvent
device
InputEventWithModifiers
alt
shift
control
meta
command
InputEventMouse
buttonmask
position
global
position
InputEventMouseMotion
relative
speed
Script
script

event methods:
setrelative
get
relative
setspeed
get
speed
setbuttonmask
getbuttonmask
setposition
get
position
setglobalposition
getglobalposition
setalt
get
alt
setshift
get
shift
setcontrol
get
control
setmetakey
get
metakey
setcommand
get
command
setdevice
get
device
isaction
is
actionpressed
is
actionreleased
get
actionstrength
is
pressed
isecho
as
text
shortcutmatch
is
actiontype
xformed
by
setuplocaltoscene
setpath
take
overpath
get
path
setname
get
name
getrid
set
localtoscene
islocaltoscene
get
localscene
setup
localtoscene
duplicate
initref
reference
unreference
free
_notification
_set
_get
_get
propertylist
_init
get_class
is
class
set
get
setindexed
get
indexed
getpropertylist
getmethodlist
notification
getinstanceid
setscript
get
script
setmeta
get
meta
hasmeta
get
metalist
add
usersignal
has
usersignal
emit
signal
call
calldeferred
set
deferred
callv
hasmethod
get
signallist
get
signalconnectionlist
getincomingconnections
connect
disconnect
isconnected
set
blocksignals
is
blockingsignals
property
listchangednotify
setmessagetranslation
cantranslatemessages
tr
isqueuedfor_deletion

answered Mar 3, 2019 by samy (21 points)
0 votes

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

answered Mar 2, 2019 by Elis (87 points)

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

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.