Control UI touchGesture cancels existing hold action

Post your questions and help other users.

Moderator: Martin

Post Reply
Gen
Posts: 23
Joined: 09 Mar 2019 10:02

Control UI touchGesture cancels existing hold action

Post by Gen » 27 Feb 2020 18:30

Hi,

I'm trying to simulate continuous screen taps without interrupting existing user performed input. I'm using the Control UI action with touchGesture (click doesn't work in this app) to simulate touches on the left side of the screen with a sleep and loop of 100ms. This action works okay on it's own. However, when the first action is performed it seems to de-register the existing user performed hold action. For example - if I hold on the right side of the screen and execute the flow - the hold becomes no longer active.

Is there a way to avoid this?

I've tried using root command to simulate the tap input but that doesn't seem to execute fast enough.

Thanks,
Gen.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Control UI touchGesture cancels existing hold action

Post by Desmanto » 01 Mar 2020 18:35

Do you mean you want to protect the screen for mis touching during CUI execution? If yes, then use overlay widget with clickable setting enabled. No need to configure the action, just leave it blank. The widget should be shown full screen, covering almost everything when CUI is executing. After finish, hide the widget again, if not, you will be locked out by the your widget. Make sure you do small test first, starting the widget size small (such as 200x200) before trying full screen.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Gen
Posts: 23
Joined: 09 Mar 2019 10:02

Re: Control UI touchGesture cancels existing hold action

Post by Gen » 01 Mar 2020 20:26

Hi Desmanto,

Thanks for your reply but I think I haven't explained myself clear enough.

I basically want to create a macro that would loop a touch with 100ms intervals on the left side of the screen until I turn it off.

The problem is that I also need this to run while I'm manually holding the right side of the screen. So I would hold the right side of the screen then execute the macro and expect multiple inputs: one hold action on the right side of the screen and simultaneously many taps on the left side of the screen. What seems to happen though is that when I execute the touchGesture action, my initial hold becomes no longer active.

You can simulate this by turning on pointer location in developer options. If you hold one part of the screen and then tap on another, you will see two sets of crosshair points. However, if you create a flow to simulate touch, then hold the screen and execute the flow, your initial crosshair disappears.

You could also use a paint application to demonstrate this.

Hope this makes sense.

Thanks,
Gen.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Control UI touchGesture cancels existing hold action

Post by Desmanto » 02 Mar 2020 13:55

touchGesture() seems can't be used combined with separate touch. It can support multi swipe, but seems to be done on separate input x y swipe. So it is choppy and doesn't support long press. If you try to record gesture pinch to zoom, you can see the effect is choppy when you execute the CUI script.

Paint doesn't support multi touch, so the best is to enable show pointer location to see the touch.

I don't know if this will work at your case. You can try to record multiple touch and edit the timing to get the long press and multiple single tap you need. Try to record gesture, tap at the left and right at the same time. You will get something like this

Code: Select all

touchGesture(1, 1, newList(66, 1089),
             0, 1, newList(964, 1069));
the 1,1 and 0,1 is the timing of the start and end. edit this to 0, and the end of the time, example 5000. Then the first list is the left touch, you want to do multiple clicks on it. Copy the left coordinate to multiple times, as many as the click you want within that 5000 miliseconds. Example try to do 10 times only in 5000 miliseconds (I don't know if it can work faster than that, better try longer value first). Leave the right click coordinate unchanged, means it is long press for 5000 miliseconds.

Code: Select all

touchGesture(0, 5000, newList(66, 1089, 66, 1089, 66, 1089, 66, 1089, 66, 1089, 66, 1089, 66, 1089, 66, 1089, 66, 1089, 66, 1089),
             0, 5000, newList(964, 1069));
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply