Page 1 of 1
Root command > double tap
Posted: 07 Dec 2015 20:12
by MURTUMA
Is it possible to simulate a double tap with one root command action? Or even better, any amount of single successive taps?
I've been able to the latter with a loop. It is slow but usable nonetheless. However, the loop is not fast enough to simulate actual double tap in most cases. That's a bit problematic as I've been unable to find a workaround. Control ui action doesn't work.
Re: Root command > double tap
Posted: 07 Dec 2015 20:33
by Martin
You could try to execute input tap within one
Execute Root Command:
input tap x y;input tap x y
input tap is known to be quite slow so it might still not be fast enough. You could also try to tame commands
getevent and
sendevent, however, I have not tried myself. This thread on stackoverflow sounds promising:
http://stackoverflow.com/a/24038245
Installing a specialized app like FRep or RepetiTouch might be an alternative.
Re: Root command > double tap
Posted: 08 Dec 2015 13:41
by MURTUMA
The ";" separated list works nicely. Double tapping still a bit unreliable, if cpu usage is high when the action executes but still a lot better than before.
How can I create ";" separated list in a script action with predefined list length? It would make the flow lighter overall.
Re: Root command > double tap
Posted: 09 Dec 2015 19:33
by Martin
One way would be a script like this:
a = "";
for(i in [1 to 2])
{
a = a + "input tap x y;";
}
Alternatively a script like this should also work:
command = replace("x;x;", "x", "input tap x y");
You could also do this directly inline within action Execute Root Command with {replace("x;x;", "x", "input tap x y")}.
Re: Root command > double tap
Posted: 10 Dec 2015 13:55
by MURTUMA
Thank you! The script works nicely.
Re: Root command > double tap
Posted: 11 Dec 2015 16:29
by MURTUMA
I noticed that when executing very long list of commands, they won't stop when stopping the flow but keep executing to the end of the list. I realize this "bug" is not entirely AM's fault but is there anything you could do to improve this behavior?
Re: Root command > double tap
Posted: 11 Dec 2015 19:50
by Martin
Unfortunately it's quite tricky and might cause problems on some ROMs/root implementations.
I recommend to split the commands into multiple actions so that you can interrupt the flow faster.
Depending on command, you could also write the process ID of your script into a file and then use another root command to kill the process.
Something like this could work:
Execute Root Command: echo $$>/storage/emulated/0/pid.txt;your long script...
in a flow that stops the other:
Init Variable Text File: /storage/emulated/0/pid.txt
Execute Root Command: kill -9 {file_text}