Using AutoInput for screentouch detection

584 views
Skip to first unread message

nmyshkin

unread,
Jun 24, 2020, 4:02:25 PM6/24/20
to Tasker
I'm still struggling to find a way to create my own screen timeouts based on UI interaction (or lack of). I found this profile on Tasker.net but it doesn't seem to do anything at all:

Profile: screen touch logger(orginal) (9)
    Event: AutoInput UI Action [ Configuration:Action Types: Clicks ]
    State: Variable Value  [ %Debugmode > 0 ]
    Enter: Anon (7)
    A1: Flash [ Text:%aicoordinates, %aielementid Long:On ] If [ %Debugmode > 1 ]
    A2: Write File [ File:Tasker/factory/keystoredebug.txt Text:%aicoordinates, %aielementid Append:On Add Newline:On ] 

I don't understand the %Debugmode variable.


Dale Smith

unread,
Jun 25, 2020, 10:53:36 AM6/25/20
to Tasker
It's only used as a conditional so it must be set somewhere else.

Paul Chapman

unread,
Jun 27, 2020, 8:48:25 AM6/27/20
to Tasker
You could try something like this. Obviously the task portion can be whatever you need it to be. This was just proof of concept.

Profile: T: Logcat Screen Touched (140)
Restore: no
Event: Logcat Entry [ Output Variables:* Component:TouchInteractionService Filter:action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]= Grep Filter (Check Help):Off ]
Enter: Anon (141)
A1: AutoTools Regex [ Configuration:Text: %lc_text
Regex: (?<ignore>x\[0\]\=)(?<x_coord>\d{1,4}\.\d) Timeout (Seconds):60 ]
A2: AutoTools Regex [ Configuration:Text: %lc_text
Regex: (?<ignore>y\[0\]\=)(?<y_coord>\d{1,4}\.\d) Timeout (Seconds):60 ]
A3: Flash [ Text:X: %x_coord
Y: %y_coord Long:Off ]

Logan Fury

unread,
Jun 27, 2020, 7:59:20 PM6/27/20
to Tasker
May I ask for an .xml download for this please?

Paul Chapman

unread,
Jun 28, 2020, 10:55:28 AM6/28/20
to Tasker
Sure.


<TaskerData sr="" dvi="1" tv="5.9.2">
<Profile sr="prof140" ve="2">
<cdate>1586529999240</cdate>
<clp>true</clp>
<edate>1593262021154</edate>
<flags>8</flags>
<id>140</id>
<limit>true</limit>
<mid0>141</mid0>
<nme>T: Logcat Screen Touched</nme>
<Event sr="con0" ve="2">
<code>2085</code>
<pri>0</pri>
<Bundle sr="arg0">
<Vals sr="val">
<net.dinglisch.android.tasker.RELEVANT_VARIABLES>&lt;StringArray sr=""&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0&gt;%lc_text
Text
The text that corresponds to the matched logcat entry&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0&gt;&lt;/StringArray&gt;</net.dinglisch.android.tasker.RELEVANT_VARIABLES>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">TouchInteractionService</Str>
<Str sr="arg2" ve="3">action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=</Str>
<Int sr="arg3" val="0"/>
</Event>
</Profile>
<Task sr="task141">
<cdate>1586530004958</cdate>
<edate>1586545058954</edate>
<id>141</id>
<pri>6</pri>
<Action sr="act0" ve="7">
<code>1910383148</code>
<Bundle sr="arg0">
<Vals sr="val">
<DetectUrl>false</DetectUrl>
<DetectUrl-type>java.lang.Boolean</DetectUrl-type>
<GetMultipleResults>false</GetMultipleResults>
<GetMultipleResults-type>java.lang.Boolean</GetMultipleResults-type>
<OutputText>&lt;null&gt;</OutputText>
<OutputText-type>java.lang.String</OutputText-type>
<Regex>(?&lt;ignore&gt;x\[0\]\=)(?&lt;x_coord&gt;\d{1,4}\.\d)</Regex>
<Regex-type>java.lang.String</Regex-type>
<Text>%lc_text</Text>
<Text-type>java.lang.String</Text-type>
<UseJavascript>false</UseJavascript>
<UseJavascript-type>java.lang.Boolean</UseJavascript-type>
<UseRegexPlus>false</UseRegexPlus>
<UseRegexPlus-type>java.lang.Boolean</UseRegexPlus-type>
<com.twofortyfouram.locale.intent.extra.BLURB>Text: %lc_text
Regex: (?&lt;ignore&gt;x\[0\]\=)(?&lt;x_coord&gt;\d{1,4}\.\d)</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<config_RequestDesktopVersion>false</config_RequestDesktopVersion>
<config_RequestDesktopVersion-type>java.lang.Boolean</config_RequestDesktopVersion-type>
<net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>Text Regex plugininstanceid plugintypeid </net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>
<net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>java.lang.String</net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
<plugininstanceid>b4342f41-01f8-4a8d-84cd-1cd2f5729bb2</plugininstanceid>
<plugininstanceid-type>java.lang.String</plugininstanceid-type>
<plugintypeid>com.joaomgcd.autotools.intent.IntentRegex</plugintypeid>
<plugintypeid-type>java.lang.String</plugintypeid-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">com.joaomgcd.autotools</Str>
<Str sr="arg2" ve="3">com.joaomgcd.autotools.activity.ActivityConfigRegex</Str>
<Int sr="arg3" val="60"/>
</Action>
<Action sr="act1" ve="7">
<code>1910383148</code>
<Bundle sr="arg0">
<Vals sr="val">
<DetectUrl>false</DetectUrl>
<DetectUrl-type>java.lang.Boolean</DetectUrl-type>
<GetMultipleResults>false</GetMultipleResults>
<GetMultipleResults-type>java.lang.Boolean</GetMultipleResults-type>
<OutputText>&lt;null&gt;</OutputText>
<OutputText-type>java.lang.String</OutputText-type>
<Regex>(?&lt;ignore&gt;y\[0\]\=)(?&lt;y_coord&gt;\d{1,4}\.\d)</Regex>
<Regex-type>java.lang.String</Regex-type>
<Text>%lc_text</Text>
<Text-type>java.lang.String</Text-type>
<UseJavascript>false</UseJavascript>
<UseJavascript-type>java.lang.Boolean</UseJavascript-type>
<UseRegexPlus>false</UseRegexPlus>
<UseRegexPlus-type>java.lang.Boolean</UseRegexPlus-type>
<com.twofortyfouram.locale.intent.extra.BLURB>Text: %lc_text
Regex: (?&lt;ignore&gt;y\[0\]\=)(?&lt;y_coord&gt;\d{1,4}\.\d)</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<config_RequestDesktopVersion>false</config_RequestDesktopVersion>
<config_RequestDesktopVersion-type>java.lang.Boolean</config_RequestDesktopVersion-type>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES>&lt;StringArray sr=""&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0&gt;%ignore
First "ignore"
First match for group "ignore"&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES0&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES1&gt;%regexgroups()
Regex Groups
Regex Groups&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES1&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES2&gt;%regexmatch
Regex Match
Regex Match&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES2&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES3&gt;%y_coord
First "y_coord"
First match for group "y_coord"&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES3&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES4&gt;%err
Error Code
Only available if you select &amp;lt;b&amp;gt;Continue Task After Error&amp;lt;/b&amp;gt; and the action ends in error&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES4&gt;&lt;_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES5&gt;%errmsg
Error Message
Only available if you select &amp;lt;b&amp;gt;Continue Task After Error&amp;lt;/b&amp;gt; and the action ends in error&lt;/_array_net.dinglisch.android.tasker.RELEVANT_VARIABLES5&gt;&lt;/StringArray&gt;</net.dinglisch.android.tasker.RELEVANT_VARIABLES>
<net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>[Ljava.lang.String;</net.dinglisch.android.tasker.RELEVANT_VARIABLES-type>
<net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>Text Regex plugininstanceid plugintypeid </net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS>
<net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>java.lang.String</net.dinglisch.android.tasker.extras.VARIABLE_REPLACE_KEYS-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
<plugininstanceid>b4342f41-01f8-4a8d-84cd-1cd2f5729bb2</plugininstanceid>
<plugininstanceid-type>java.lang.String</plugininstanceid-type>
<plugintypeid>com.joaomgcd.autotools.intent.IntentRegex</plugintypeid>
<plugintypeid-type>java.lang.String</plugintypeid-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">com.joaomgcd.autotools</Str>
<Str sr="arg2" ve="3">com.joaomgcd.autotools.activity.ActivityConfigRegex</Str>
<Int sr="arg3" val="60"/>
</Action>
<Action sr="act2" ve="7">
<code>548</code>
<Str sr="arg0" ve="3">X: %x_coord
Y: %y_coord</Str>
<Int sr="arg1" val="0"/>
</Action>
</Task>
</TaskerData>

Logan Fury

unread,
Jun 28, 2020, 12:18:46 PM6/28/20
to tas...@googlegroups.com
Sorry should have been more specific - may I have a link to download it? Taskernet if you've time :) 

--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/aLmf0nOU_N8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/b833c8c8-24c9-4f42-8fca-041d0a275382o%40googlegroups.com.

Paul Chapman

unread,
Jun 28, 2020, 1:59:04 PM6/28/20
to Tasker

Logan Fury

unread,
Jun 28, 2020, 2:23:18 PM6/28/20
to tas...@googlegroups.com
Thank you so much Paul! I had to recreate trigger for my Samsung, but your trigger gave the clue to find it. Here is my working version:

    Profile: Logcat Screen Touched (818)
    Restore: no
    Event: Logcat Entry [ Output Variables:* Component:AccessibilityInputFilter Filter:Handling motion event: MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]= Grep Filter (Check Help):Off ]
    Enter: Screen Touch (816)
    A1: AutoTools Regex [ Configuration:Text: %lc_text
    Regex: (?<ignore>x\[0\]\=)(?<x_coord>\d{1,4}\.\d) Timeout (Seconds):60 ] 
    A2: AutoTools Regex [ Configuration:Text: %lc_text
    Regex: (?<ignore>y\[0\]\=)(?<y_coord>\d{1,4}\.\d) Timeout (Seconds):60 ] 
    A3: Flash [ Text:X: %x_coord
    Y: %y_coord Long:Off ] 
   

This is great! Much faster & easier than enabling/disabling touch loc in dev options :) 



--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/aLmf0nOU_N8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.

nmyshkin

unread,
Jun 28, 2020, 5:15:56 PM6/28/20
to Tasker
Thanks for your response I'm a little late on the reply but still very interested. I confess that I don't follow much of what you have suggested. I don't seem to have the option of "Logcat Entry" as an Event choice, or else there is something else I just don't understand. I tried importing the Profile via Taskernet but my device just didn't want to do it this time, though I've done one in the past.

Also tried constructing the xml from your earlier post but there are lines in there that I guess are comments (?) and that didn't work either.

So if I understand anything at all, it looks like the principle is to examine the logcat at some point (when?) and if a screen touch is detected, set a variable or flash screen coordinates, etc. Logcats are constantly running and I'm having trouble imagining how this would work or how long it might take to examine the file for the correct entry.

So far I've had no luck at all getting AutoInput to do anything other than take up internal storage space. I've not tried AutoTools yet, but will now look into it. This is turning out to be a lot more difficult than I had anticipated!

On Saturday, June 27, 2020 at 5:48:25 AM UTC-7, Paul Chapman wrote:

Paul Chapman

unread,
Jun 30, 2020, 2:02:19 AM6/30/20
to Tasker
In Tasker, I create a new profile. Then I choose event. When that window opens I filter for Logcat. This week trigger whatever action you create everything the screen is touched. If you don't have the logcat event under profile, you may need to update to the latest version of Tasker. Hope this helps.

Screenshot_20200630-015540.jpg

Reply all
Reply to author
Forward
0 new messages