This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
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 ?

in Engine by (21 points)
edited by

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

by (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

by (86 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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.