Page 1 of 1
need xy OnTap
Posted: 09 Nov 2014 17:38
by Mucatigoa
I want an overlay that knows where it was tapped = relative X Y coords. Like an Ontap function. As a bonus, if any tap/swipe occurred outside the overlay.
Can this be done with a widget?
Re: need xy OnTap
Posted: 10 Nov 2014 16:24
by Martin
No sorry, that's currently not possible with a widget. Watching taps outside the widget is also not possible and I think that this can not be done anymore on newer versions of Android.
On a rooted device you could try to react to touch input using trigger
Command Output and command
getevent.
This post contains some hints to react to volume buttons but touch input should also be visible in the output of the command when I recall correctly.
Re: need xy OnTap
Posted: 10 Nov 2014 17:18
by Bushmills
How about a 0% opacity widget overlay with dimensions of screen?
Re: need xy OnTap
Posted: 10 Nov 2014 17:26
by Martin
This would consume the touch event which might not be the desired result, but otherwise this should work.
Re: need xy OnTap
Posted: 10 Nov 2014 19:29
by Mucatigoa
Another way is with a grid of very small buttons...
Re: need xy OnTap
Posted: 10 Nov 2014 21:19
by Martin
Version 1.25 will provide variables
screen_x and
screen_y to the executed clickable action (for example action
Execute Flows assigned as the single action of a widget). This only works for overlays but not for regular widgets placed on the launcher/lock screen. Note that the widget consumes the touch event so it's a good idea to use a widget that does not cover the entire screen like I did

.
Re: need xy OnTap
Posted: 10 Nov 2014 21:23
by MURTUMA
When the overlay consumes the click event, maybe it's possible to reproduce it with control ui action underneath the overlay?
Re: need xy OnTap
Posted: 12 Nov 2014 15:45
by Martin
Unfortunately Control UI has to use the accessibility features to simulate clicks on user interface elements which does not work on all elements (games, graphical elements etc.).
On a rooted device you could use Execute Root Command: input tap x y to simulate touch input that will work on more user interface elements.