Thanks for the great work GermainZ ... This script works great. :)
I have already been able to figure out a few buttons and put together a keyboard shortcut for pasting in tasker. I have posted it here:
I have very little experience with shell script or using a terminal emulator but was able to muddle my way through and figure most of it out. So I thought i would post a small newbie help guide here for others..
- you need to set the terminal for root.. this is done by simply entering "su" ( no quotes ) in the terminal
- copying and pasting the script did not work for me at all. You should run the downloaded file from the terminal. Use the command: exec sh /mnt/sdcard/download/getevent_to_sendevent.txt ( you will have to use your file path of course.)
- The one thing that tripped me up the most was after reading the tutorial and seeing the example that on GermainZ's device the menu button had 4 events I ASSumed that my menu button would have 4 events as well BZZZZZTT... Wrong answer... on my device the menu button has 14 events ( 7 for button down 7 for button up) and my "v" button has 10 ( 5 down, 5 up)
Unfortunately I did not understand the hint about how to spam the screen for output. I probably did it the hard way and copied the entire output to a text editor then copied what I thought might be the correct code and pasted it back into the terminal. Hopefully GermainZ could post a a few tips on this approach....
Here are the 2 buttons I figured out for my DROID 4 ..
Menu Button:
sendevent /dev/input/event4 3 53 95
sendevent /dev/input/event4 3 54 1017
sendevent /dev/input/event4 3 48 15
sendevent /dev/input/event4 3 50 1
sendevent /dev/input/event4 3 57 0
sendevent /dev/input/event4 0 2 0
sendevent /dev/input/event4 0 0 0
sendevent /dev/input/event4 3 53 95
sendevent /dev/input/event4 3 54 1017
sendevent /dev/input/event4 3 48 0
sendevent /dev/input/event4 3 50 1
sendevent /dev/input/event4 3 57 0
sendevent /dev/input/event4 0 2 0
sendevent /dev/input/event4 0 0 0
"v" Button
sendevent /dev/input/event1 3 2 265
sendevent /dev/input/event1 0 0 0
sendevent /dev/input/event3 4 4 15
sendevent /dev/input/event3 1 47 1
sendevent /dev/input/event3 0 0 0
sendevent /dev/input/event1 3 2 269
sendevent /dev/input/event1 0 0 0
sendevent /dev/input/event3 4 4 15
sendevent /dev/input/event3 1 47 0
sendevent /dev/input/event3 0 0 0
As you can see there is a 0 0 0 In between the down and up button but also note that a. 0 0 0 Can be included in the button sequence as well. In the end I figured it out by setting it for 100 events then pressing the button on/off multiple times during the test then checking for a pattern in the output.
Hope this helps.... Rich..
Alright. So this goes in tasker as a javascript?
Ive been serching the internet, playstore, blackmarket alpha, xda, for about 4 days now.
Hence why I asked. I wouldnt have otherwise.
Not sure if im searching with the wrong words or what...
I never said anyone was wrong.
I start by opening smanager.
The make new script. Paste your script in there. Then I make it my fav. And turned on root. Then run it. It sits there at..
Events to catch? >
Then I goto console and click run shell.
I paste in your little script thingy..
No idea what im doing at this point.. this is what I get.
exec sh -c "cd '/storage/sdcard0' ; exec /system/bin/sh"
'/storage/sdcard0' ; exec /system/bin/sh" <
t /dev/input/event5 0 0 0 /dev/input/event5 0 0 0 1 Go! sendevent /dev/input/event5 1 102 1 s*
/system/bin/sh: vents: not found
127|root@android:/storage/sdcard0 #
Ok so to me that = broken. :p
So then I think.. ok what about paste were it says..
Events to catch? >
This is what I get..
Events to catch? > Events to catch? > 4 Gonna catch 4 events... Starting in... 3 2 1 Go! sendevent /dev/input/event5 1 102 1 sendevent /dev/input/event5 0 0 0 sleep 3 sendevent /dev/input/event5 1 102 0 sendevent /dev/input/event5 0 0 0
Gonna catch Events to catch? > 4 Gonna catch 4 events... Starting in... 3 2 1 Go! sendevent /dev/input/event5 1 102 1 sendevent /dev/input/event5 0 0 0 sleep 3 sendevent /dev/input/event5 1 102 0 sendevent /dev/input/event5 0 0 0 events...
Starting in...
3
2
1
Go!
tail: invalid number 'Events'
Usage: getevent [-t] [-n] [-s switchmask] [-S] [-v [mask]] [-d] [-p] [-i] [-l] [-q] [-c count] [-r] [device]
-t: show time stamps
-n: don't print newlines
-s: print switch states for given bits
-S: print all switch states
-v: verbosity mask (errs=1, dev=2, name=4, info=8, vers=16, pos. events=32, props=64)
-d: show HID descriptor, if available
-p: show possible events (errs, dev, name, pos. events)
-i: show all device info and possible events
-l: label event types and names in plain text
-q: quiet (clear verbosity mask)
-c: print given number of events then exit
-r: print rate events are received
This is as far as ive gotten using smanager.
Oh and the game. Its called "fish live" ive used cih to kinda alter the code to have more than 30 fish in the tank. I have to click the screen to put fish in it. Every.... time..... :/
Hope this is useful. And I apologies for my previous comments. Been workin 60hrs week. Well.. im just stressed.
Thsnks.
sendevent /dev/input/event5 1 102 1
sendevent /dev/input/event5 0 0 0
sendevent /dev/input/event5 1 102 0
sendevent /dev/input/event5 0 0 0
Cheers.
Tom
I am glad to see we are all playing nice now. :) ... I actually did not reply earlier because I found your first few posts to be nondescript and confusing as well..
So here is my 2 cents for what it is worth..
> Then I goto console and click run shell.
> I paste in your little script thingy..
> No idea what im doing at this point.. this is what I get.
I am not sure but this might be where the trouble starts.. if you read my post above for newbies (like me) I found that when I copied and pasted the script into the terminal it did run, but not correctly.. you need to run the script from the terminal by using the command:
exec sh /mnt/sdcard/download/getevent_ to_sendevent.txt ( you will have to use your file path of course.)
I am sure this will work however I think getting a screen tap may be a somewhat trickier than a button.
Another approach can be found if you search the group for "Speed up DPAD presses? " This may be a easier method for a screen tap.
Hi,I didn't get an option to specify how many events to catch?Whereabouts do I specify this?I opened it in scriptmanager with root checked.
EDIT3: Here's one fix you could try if you're getting an error related to "read -p", replace the first line by: echo "Events to catch? > "; read l
https://www.dropbox.com/s/ugc9j6f1bqu0qw0/geteventsendevent.sh
https://www.dropbox.com/s/ugc9j6f1bqu0qw0/geteventsendevent.sh
echo $t1
grep -v -E "add device|name:" | while IFS=' ' read -r t1 a b c d _; do
grep -v -E "add device|name:" | while IFS=' ' read -r t1 a b c d _; do
echo $t1
t1=${t1%%-*}
Scott, just to double check.. what command are you using in the terminal to run the file?
Rich..
--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
> I'm executing it as a script, using SD Manager in root mode, as recommended.
>
I was actually asking if you were using the "exec sh" command to run the download file?
getevent -c 1
getevent -t -c 1
15646-165468:
[ 15646-165468 ]
getevent -t -c 1
https://www.dropbox.com/s/ugc9j6f1bqu0qw0/geteventsendevent.sh
grep -v -e "add device" -e "name:" | sed -e "s/^\[ //" -e "s/-/./" -e "s/://" -e "s/\]//" -e "s/.[0-9]* / /" | while IFS=' ' read -r t1 _; do
echo $t
done
getevent -t -c 4 | grep -v -e "add device" -e "name:"
-e "s/.[0-9]* / /"
-e "s/\.[0-9]* / /"
https://www.dropbox.com/s/ugc9j6f1bqu0qw0/geteventsendevent.sh
t2=-1
t2=0
https://www.dropbox.com/s/ugc9j6f1bqu0qw0/geteventsendevent.sh
https://www.dropbox.com/s/ugc9j6f1bqu0qw0/geteventsendevent.sh
As usual, the link is still the same:
https://www.dropbox.com/s/ugc9j6f1bqu0qw0/geteventsendevent.sh
sh /path/to/script
sh /sdcard/testscript.txt
OK. so i have read through every comment and i have it working. I figured out how to select the text i want as far as the "touches" i wanna use. Now im just trying to figure out how to get it to run in Tasker. i made a testscript.txt with what i want it to run but how exactly do i get it to run in tasker??
btw, the old version was very confusing and this new update is VERY clear and easy ti pick up if you have never done any type of command line prompt. great job on this.
sendevent /dev/input/event2 3 57 19725
sendevent /dev/input/event2 3 53 364
sendevent /dev/input/event2 3 54 1211
sendevent /dev/input/event2 3 50 13
sendevent /dev/input/event2 3 48 9
sendevent /dev/input/event2 3 49 6
sendevent /dev/input/event2 3 60 0
sendevent /dev/input/event2 0 0 0
sendevent /dev/input/event2 3 53 363
sendevent /dev/input/event2 3 50 12
sendevent /dev/input/event2 3 61 2
sendevent /dev/input/event2 0 0 0
sendevent /dev/input/event2 3 53 362
sendevent /dev/input/event2 3 50 14
sendevent /dev/input/event2 3 61 0
sendevent /dev/input/event2 0 0 0
sendevent /dev/input/event2 3 57 4294967295
sendevent /dev/input/event2 0 0 0
sleep 2
sendevent /dev/input/event2 3 57 19726
sendevent /dev/input/event2 3 53 44
sendevent /dev/input/event2 3 54 890
sendevent /dev/input/event2 3 50 16
sendevent /dev/input/event2 3 49 5
sendevent /dev/input/event2 0 0 0
sendevent /dev/input/event2 3 57 4294967295
sendevent /dev/input/event2 0 0 0
sleep 1
sendevent /dev/input/event2 3 57 19727
sendevent /dev/input/event2 3 53 683
sendevent /dev/input/event2 3 54 906
sendevent /dev/input/event2 3 50 11
sendevent /dev/input/event2 3 48 8
sendevent /dev/input/event2 3 60 5
sendevent /dev/input/event2 0 0 0
sendevent /dev/input/event2 3 53 681