4

An action to get the cordinates of the current fingers on the screen.

I'm planing a useful task, but there is a crutial step, which is getting the current finger location on the screen, and see if the finger is touching on a specific area, then perform different actions. 

I've searched many methods, but neither Tasker Actions nor Plugins can offer the touched location. I know that using Java Function (android.view.accessibility) might be able to do it, but it's a pity I'm not knowlegeable about java function.

So here I wish Joao Dias could add Tasker an action of getting touched location. This action would bring greatly convinience for some scenes.

2 replies

JC

I've desperately wanted this myself and I've gotten sidetracked before finishing, but I might've found a way to do it using local HTML source that includes a script like the following in AutoTools Webview:

<!DOCTYPE html>

<html>

<meta name="viewport" content="width=device-width, initial-scale=1">

<body ontouchstart="showCoordinates(event)" ontouchmove="showCoordinates(event)">

<h1>The TouchEvent's touches Property</h1>

<p>Touch anywhere between the top and bottom line of the text in this view.</p>

<p>The horizontal and vertical coordinates of the touch are: <span id="demo"></span></p>

<p><strong>Note:</strong> This examples uses touches<strong>[0]</strong> meaning that it will only show the coordinates of one finger (the first).</p>

<p><strong>Note:</strong> Touch events works for touch devices only.</p>

<script>

function showCoordinates(event) {

  var x = event.touches[0].clientX;

  var y = event.touches[0].clientY;

  document.getElementById("demo").innerHTML = x + ", " + y;

}

</script>

It *instantly* reports x and y as you touch the screen and updates the values as you drag your finger around in the defined area.

I'm hoping to figure out a way to create a transparent full screen overlay to capture what I want.

I can post a demo task on Taskernet if anyone's interested.  If anyone gets an overlay working, please post a follow-up.

NK

Not sure if this helps, if you enable the "Pointer location" in developer settings it shows the x,y of the finger location on the top of the screen. At-least I use this for my Autoinput tasks..:)