Z1C and Tasker automation

Search This thread

wyt18

Senior Member
Thought I would create a thread to discuss Tasker automation on the Z1C (help requests, troubleshooting, automation ideas, etc.)

First a help request:

Has anyone been successful in getting AutoInput or Sendevent shell commands (double taps, swipes) to work on the Z1C?
I've used this script in the past to record events and replicate them to create macros using Tasker shell, but the Z1C input devices (touchscreen, buttons) don't seem to be allowing capture using getevent:
http://xdaforums.com/showthread.php?t=2233865
 

Maetz3

Senior Member
Mar 31, 2009
131
33
Thought I would create a thread to discuss Tasker automation on the Z1C (help requests, troubleshooting, automation ideas, etc.)

First a help request:

Has anyone been successful in getting AutoInput or Sendevent shell commands (double taps, swipes) to work on the Z1C?
I've used this script in the past to record events and replicate them to create macros using Tasker shell, but the Z1C input devices (touchscreen, buttons) don't seem to be allowing capture using getevent:
http://xdaforums.com/showthread.php?t=2233865

Edit: always execute as root!!!!

task Swipe:
Script
execute Shell
input swipe x1 y1 x2 y2 speed
like:
input swipe 310 870 310 320 200

keyevents:
http://developer.android.com/reference/android/view/KeyEvent.html
like
power on/off
input keyevent 26 or
input keyevent KEYCODE_POWER

pause between actions:
sleep 1
sleep 2 etc.

tap:
input tap x y

start app:
am start -n app.name.name/ManifestActivity

close app:
am force-stop app.name.name

complete action screen on, unlock, start spotify, autoplay, screen off
am start -n com.spotify.music/.MainActivity;
sleep 2;
input keyevent 26;
sleep 1;
input swipe 310 870 310 320 200;
sleep 1;
input keyevent 126;
sleep 1;
input keyevent 26;

i hope it help :)
 

wyt18

Senior Member
Edit: always execute as root!!!!

task Swipe:
Script
execute Shell
input swipe x1 y1 x2 y2 speed
like:
input swipe 310 870 310 320 200

keyevents:
http://developer.android.com/reference/android/view/KeyEvent.html
like
power on/off
input keyevent 26 or
input keyevent KEYCODE_POWER

pause between actions:
sleep 1
sleep 2 etc.

tap:
input tap x y

start app:
am start -n app.name.name/ManifestActivity

close app:
am force-stop app.name.name

complete action screen on, unlock, start spotify, autoplay, screen off
am start -n com.spotify.music/.MainActivity;
sleep 2;
input keyevent 26;
sleep 1;
input swipe 310 870 310 320 200;
sleep 1;
input keyevent 126;
sleep 1;
input keyevent 26;

i hope it help :)

thanks! very helpful.

what about multi-touch or pinch-to-zoom? have not been able to find solutions that have bridged that online

double tap also seems to be a challenge for the Z1C, somehow even without sleep in between two "input taps" it is still too slow to be recognized as a double tap
 

Maetz3

Senior Member
Mar 31, 2009
131
33
thanks! very helpful.

what about multi-touch or pinch-to-zoom? have not been able to find solutions that have bridged that online

double tap also seems to be a challenge for the Z1C, somehow even without sleep in between two "input taps" it is still too slow to be recognized as a double tap

i dont know but i think you need something like nova launcher

i think you can combine this controls in tasker

for zoom you can use:
KEYCODE_ZOOM_IN (input keyevent 168)
KEYCODE_ZOOM_OUT (input keyevent 169)
 
Last edited:
  • Like
Reactions: wyt18

wyt18

Senior Member
i dont know but i think you need something like nova launcher

i think you can combine this controls in tasker

for zoom you can use:
KEYCODE_ZOOM_IN (input keyevent 168)
KEYCODE_ZOOM_OUT (input keyevent 169)

Thanks ... tried the ZOOM_IN/OUT keyevents, but I think that is for the camera, I'm trying to implement this on Google Maps and Maps Engine, since they removed the Zoom and Scaling buttons on the official Google apps it's been a pain (and driving hazard) to manually zoom in and out with touchscreen input. (trying to map the zoom actions to my media controls on the steering wheel)
 

dan34321

Member
Nov 30, 2014
11
0
Hi all,

Let me start with an apology as I am not sure that I am in the right thread here, however tasker automation does seem to have alot of threads :) - I am confident that someone who knows more than me might be able to answer my questions/problems.
I am currently trying to automate a search in youtube using autovoice and autoinput. Via voice command so far I can get autoinput to launch youtube, and click the search bar, however I cant get it to input any text into the search bar! - So I really need to know, how to get autoinput to input variable text and search for it within youtube, not even sure which function of autoinput it would be to be honest.
Still learning.

Any help you can give would be fantastic,
Cheers
Dan
 

wyt18

Senior Member
If what you want to achieve is to search YouTube, there are easier ways:
1. Simply ask Google Now to search or YouTube using the "watch" or "listen" command; or
2. Use an intent in Tasker to activate YouTube search with the search term %avcommnofilter (rather than try to use autoinput)

If you really must use autoinput, you can use the UI query action to find the right variable name for the search box, then use the 'autoinput action' action to paste your search term (%avcommnofilter) into the search box

Hi all,

Let me start with an apology as I am not sure that I am in the right thread here, however tasker automation does seem to have alot of threads :) - I am confident that someone who knows more than me might be able to answer my questions/problems.
I am currently trying to automate a search in youtube using autovoice and autoinput. Via voice command so far I can get autoinput to launch youtube, and click the search bar, however I cant get it to input any text into the search bar! - So I really need to know, how to get autoinput to input variable text and search for it within youtube, not even sure which function of autoinput it would be to be honest.
Still learning.

Any help you can give would be fantastic,
Cheers
Dan
 

Maciek602

Senior Member
May 10, 2013
275
208
I have a slightly different question how to make a script turning stamina mode on and off? It would be usefull because stamina sometimes prevents alarm apps from ringing in time.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    thanks! very helpful.

    what about multi-touch or pinch-to-zoom? have not been able to find solutions that have bridged that online

    double tap also seems to be a challenge for the Z1C, somehow even without sleep in between two "input taps" it is still too slow to be recognized as a double tap

    i dont know but i think you need something like nova launcher

    i think you can combine this controls in tasker

    for zoom you can use:
    KEYCODE_ZOOM_IN (input keyevent 168)
    KEYCODE_ZOOM_OUT (input keyevent 169)