Get coordinates of scene tap?

382 views
Skip to first unread message

Chris Human

unread,
Nov 6, 2014, 3:34:47 PM11/6/14
to tas...@googlegroups.com
I'm trying to make a tasker scene that duplicates the functionality of some of these new "side launchers", and it's working well for the most part. My key issue is that I want to be able to figure out exactly where the touch occurred that triggered the event. I'm using both Tap and Stroke events on a Rectangle element to detect gestures on a specific part of the screen. Depending on where the tap occurs, I want it to temporarily hide the scene and (using root) input the same tap, effectively allowing taps through the scene to the app behind. I just need to know if there's a way to find out where the tap occurred so I can put the X and Y coordinates into the root input command. Does Tasker include this information when Tap events fire? What's the variable(s) to access this information?

Matt R

unread,
Nov 6, 2014, 5:19:39 PM11/6/14
to tas...@googlegroups.com
You could try the "getevent" shell command.

Matt

Pent

unread,
Nov 7, 2014, 2:26:31 AM11/7/14
to tas...@googlegroups.com
You can't get the info out of Tasker currently but that's a good idea and I'll try and get to it in the future.

Pent

Chris Human

unread,
Nov 7, 2014, 8:54:55 AM11/7/14
to tas...@googlegroups.com
I notice as well that when an element has both a Tap and Stroke action and I swipe across the element, both the Stroke and Tap actions are triggered rather than just the Stroke as I would expect. Is this a bug or intended?

Sean Williams

unread,
Nov 7, 2014, 9:43:54 AM11/7/14
to tas...@googlegroups.com
Filter your inputs using the elements local built-in variables, like '%stroke_dir' to avoid collisions.

Chris Human

unread,
Nov 7, 2014, 9:57:22 AM11/7/14
to tas...@googlegroups.com
To be sure I understand correctly, I can check if %stroke_dir is set and assume it's a stroke and not a tap and just cancel the Tap action and allow the Stroke action to run?

Sean Williams

unread,
Nov 7, 2014, 11:47:59 AM11/7/14
to tas...@googlegroups.com
I'd suggest playing with different setups and see what works for you. Monitoring for stroke length is also a useful differentiator.

There is an 'event_type' but for me this returns 'Click' for a users tap or stroke input.

Here's a link to Taskers user guide regarding these variables,

http://tasker.dinglisch.net/userguide/en/activity_elementedit.html

Mouse Courage

unread,
May 24, 2024, 5:02:22 AMMay 24
to Tasker
Hi,

Is there a way to get position any way possible in 2024. I have a Button that uses long tap and after clicking it, I just wanted to move it upwards with my finger to switch on other buttons that it will be overlapping.

Thanks,

Kylie Desire, Paris, France

Mouse Courage

unread,
May 24, 2024, 6:58:16 PMMay 24
to Tasker
Hi, is there any advancement on the position of the finger on the screen?

On Friday, November 7, 2014 at 8:26:31 AM UTC+1 Pent wrote:

Brenden M

unread,
May 25, 2024, 1:41:47 PMMay 25
to Tasker
Hi there,

Using AutoInput (made my Tasker developer, extra purchase, well worth it) you can use something like the following:

Profile -> Event -> Plugin -> AutoInput -> UI Action

Here, you could use the features to associate, for example, clicks on specific elements in focus (the profile) with a Variable Set action (the task).

Then, what you have is the local variable, in your use you would like %aicoordinates

So the task would include Variable Set for an X and Y and then processed however you feed the variables in your subsequent workflow.

Every time the profile is triggered there will be a new local variable %aicoordinates passed to the task. 

Screenshot_20240525-103604.png
Reply all
Reply to author
Forward
0 new messages