Page 1 of 1

Detect screen touch

Posted: 11 Feb 2020 16:06
by robchoc
I have a simple loop:

Code: Select all

scroll=100;
loop=0;

while (loop <50)
{
sendKey(93);
sleep(scroll);
loop = loop + 1
}
Is there a way to exit this loop if the screen is touched?

Thanks for all the help.

Re: Detect screen touch

Posted: 11 Feb 2020 19:04
by Desmanto
No direct way, as you need root and command Output trigger to detect the touch.

The better solution is to use full screen widget. Design a transparent widget as big as your screen resolution. Give action execute flow, which is designed to stop the flow with the CUI loop script. When executing CUI script, use show widget with clickable. The transparent widget will cover the whole screen. And when you touch it, it will execute the widget helper flow and hide the widget afterward. This gives the similar effect of touching the screen and stop the CUI script.

But be careful when testing full screen widget, as you might block yourself out and have to force restart the phone. Make sure you test the transparent widget as small resolution first, before making it bigger.

The concept maybe similar to this screensaver flow : viewtopic.php?f=3&t=6963&p=19026&hilit= ... ver#p19026