Skip to main content
Version: 9.0.2

gre.touch

gre.touch(
x ,
y,
[channel]
)

Send a touch event to the application at the co-ordinates passed in through the parameters.  channel is an optional parameter.

Parameters

ParameterTypeDescription
x#numberThe x position to simulate the touch event.
y#numberThe y position to simulate the touch event.
channel#string[optional] Storyboard IO channel to send the event on, if not specified the event is added directly into the current Storyboard application event queue if neither the environment variable or global GREIONAME variable are set.

Returns

true for success, false for failure and error message string, e.g. "Can't open greio channel my_channel"

Example:

function CBTouch()
gre.touch(25, 50)
end

function CBSendTouch()
local success, error = gre.touch(25, 50, "my_channel")
if(success == false) then
print(error)
--handle error
end
end