Skip to content

Instantly share code, notes, and snippets.

@jdewind
Last active October 13, 2016 07:35
Show Gist options
  • Save jdewind/1057cf1ed97f3b62021a6da8956c3e57 to your computer and use it in GitHub Desktop.
Save jdewind/1057cf1ed97f3b62021a6da8956c3e57 to your computer and use it in GitHub Desktop.
function doTap(x, y, numTaps, delay)
delay = delay or 16000;
local fingerId = 1;
for i=numTaps,1,-1
do
touchDown(fingerId, x, y);
usleep(delay);
touchUp(fingerId, x, y);
usleep(delay);
end
end
function interleaveTaps(x1, y1, x2, y2, numTaps, delay)
delay = delay or 16000;
local fingerId = 1;
for i=numTaps,1,-1
do
if i % 2 == 0 then
touchDown(fingerId, x1, y1);
usleep(delay);
touchUp(fingerId, x1, y1);
usleep(delay);
else
touchDown(fingerId, x2, y2);
usleep(delay);
touchUp(fingerId, x2, y2);
usleep(delay);
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment