[SCRIPT] getevent -> sendevent - Easily automate screen/button taps from the shell - Miscellaneous Android Development

Intro
I originally wrote this script for LMT, but it has changed a lot since then and (hopefully) deserves its own thread.
You can check the original script's post here, or read more about (part of) what this script is automating (and how it does it) here.
You can also check the Tasker Google Groups thread about the script (clickie).
So what does this do?
It "listens" to your input actions (screen taps, button presses, etc) and turns them into a script you can use to reproduce them.
Think of it as something similar to Excel's Macro Recording feature.
Usage
Run the script, pick the first option and enter the number of events to catch. Depending on the device, one button press ~ 4 events, sometimes more. A screen tap is unpredictable as you're never touching the screen in one spot but in many close spots.
A neat trick would be to enter a high number of events (e.g. 500), do whatever you want to do then wait for ~X seconds (10 for example). Then copy the generated script but exclude everything after the line that says "sleep X".
And if you still have any doubts... try it. That's probably the best way to understand what it does and how to use it.
Custom toolbox
You need a custom toolbox (instead of the default /system/bin/toolbox) in order to use Option 2 correctly. This is because the default "getevent" command isn't line buffered, so it usually sends its output every ~50 lines.
I therefore re-compiled the toolbox (getevent is only a launcher for it) to enable line buffering. This enables the script to work at full speed - it might still be too slow, so do allow a few extra seconds (10 seconds should be safe) of no activity for it to finish.
You'll need to download the modified version, linked below, place it in /tmp/ and give it the correct permissions (chmod 755). Note that it will not persist across reboots, so keep a backup somewhere else.
Code:
https://www.dropbox.com/s/t0xhxa3xuc8m92m/toolbox
Download
You can get the latest version here.
Bugs/Suggestions
Bugs? There are no bugs.
Actually, I'm not an elite script writer, so chances are there are a few quirks. If you find any, please report them.
Also post all your suggestions and I'll try to add them.
To do
This list will be updated based on your feedback.
Thanks
The guys at #bash helped me a lot.
zeppelinrox, learned plenty of stuff from his scripts.
Everyone who tested previous versions (mostly laufersteppenwol ).
Also feel free to ask any question, or answer any potentially interesting question that should be added to this post. I'll make sure to update it with a FAQ.
Thanks
I've contacted a moderator and he said it was okay for me to post in this section instead of the Misc. Software Development section, so it wouldn't get buried within hundreds of ROMs/kernels for devices without forums. This section will be cleaned soon anyway.

worked flawlessly thanks man , example with search button with filtered inputs for xperia play
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

Update:
You're now warned if you don't have busybox installed;
Busybox not automatically creating symlinks shouldn't be an issue any longer;
The timeout option should now work, but you'll need a custom toolbox (instead of /system/bin/toolbox) to run it. Read the OP for more info.
I'm not sure if the custom toolbox will work on all devices. Please test it out, it's completely safe as you'll be placing it in /tmp/ anyway without overwriting the original, unmodified version on your device.

works fine here, too (LG Optimus 4x HD)
the only "issue" is caused by my device itself it records way too much events in a short time (good for using the phone, but bad for the script ) so ~1000 events are enough for about one or two swipe(s)
but try yourself

Can you do a YouTube tutorial or just a written one one how to use it to get an event like opening the app draw of a launcher or something.
You give some explanation but I'm still a bit lost after rereading twice.
Sent from my SPH-L710 using xda app-developers app

fabzbear said:
Can you do a YouTube tutorial or just a written one one how to use it to get an event like opening the app draw of a launcher or something.
You give some explanation but I'm still a bit lost after rereading twice.
Sent from my SPH-L710 using xda app-developers app
Click to expand...
Click to collapse
Choose option 1 or 2, wait for the countdown to finish. do whatever you want to do.
For option 2, it should be simple enough - you just put a timeout. You'll need the modified toolbox from the first post, tho.
For option 1, you have to input a certain number of events. It's just impossible to predict that (especially if you're dealing with screen taps and not just button presses), so I suggest you do this:
Put a higher number (e.g. 500) (if you're only interested in button presses, 1 button press = ~4->~10 events, depending on the device).
Do whatever you want to do.
Wait for ~10s without doing anything.
Check the script's output (by reopening the terminal emulator/script manager).
If the script has finished (500 events have been reached already), it probably didn't record everything. Restart from step 1, with a higher number (e.g. 1000).
If not, spam your touchscreen till it's done.
Copy the outputted script and search for a line that looks like "sleep 10" (where "10" is approximately the amount of seconds you waited in step 3).
Remove everything after that line.
PS: If you get spam events from other input devices you're not interested in (e.g. compass), you can use Option 4 to only monitor the touchscreen device, for example.

wow this is great! what is the minimum number of lines of code needed for one screen touch to register (e.g. pressing a button)? i try to make mine the small by pressing very quickly which works great. However, i am just curious because when i try to shorten the code by myself in any of the areas, the script does not work.

agentdude said:
wow this is great! what is the minimum number of lines of code needed for one screen touch to register (e.g. pressing a button)? i try to make mine the small by pressing very quickly which works great. However, i am just curious because when i try to shorten the code by myself in any of the areas, the script does not work.
Click to expand...
Click to collapse
Possibly two lines -
@GermainZ
Great work - now I can diagnose my power button as well as simulate it. Thanks man!

Thank you for this. I was finally able to get tasker to play Spotify with the help from this script.

GermainZ said:
Update:
You're now warned if you don't have busybox installed;
Busybox not automatically creating symlinks shouldn't be an issue any longer;
The timeout option should now work, but you'll need a custom toolbox (instead of /system/bin/toolbox) to run it. Read the OP for more info.
I'm not sure if the custom toolbox will work on all devices. Please test it out, it's completely safe as you'll be placing it in /tmp/ anyway without overwriting the original, unmodified version on your device.
Click to expand...
Click to collapse
I would like to make a script to copy current text line to clipboard. With Hackers soft keyboard, the keys to press are: HOME, SHIFT+END, CTROL+C. Anyway to do this
simulation with either "input keyevent ..." or "sendevent...".

e154037 said:
I would like to make a script to copy current text line to clipboard. With Hackers soft keyboard, the keys to press are: HOME, SHIFT+END, CTROL+C. Anyway to do this
simulation with either "input keyevent ..." or "sendevent...".
Click to expand...
Click to collapse
I don't think so, not unless you have a hard keyboard.

GermainZ said:
I don't think so, not unless you have a hard keyboard.
Click to expand...
Click to collapse
Found a way to simulate key clicks for coping current text line to clipboard. With Hackers soft keyboard, the keys to press are: HOME, SHIFT+END, CTROL+C. The following script does this simulation nicely:
#simulate key click on fn, home, shift, end, fn, ctrl, c
input touchscreen tap 870 730
input touchscreen tap 1020 450
input touchscreen tap 80 670
input touchscreen tap 1020 520
input touchscreen tap 870 730
input touchscreen tap 70 590
input touchscreen tap 400 660
The key positions are for hacker's keyboard on ASUS TF101 tablet.

Hi, thanks for the wonderful script. I get it working.
Now that I can simulate the "tap", I would like to know how to modify my script to obtain a "double tap" and a "long tap".
Thanks in advance.
PS.: This is my tap at x=248,y=164
sendevent /dev/input/event1 3 57 0
sendevent /dev/input/event1 3 53 248
sendevent /dev/input/event1 3 54 164
sendevent /dev/input/event1 3 48 1
sendevent /dev/input/event1 3 49 0
sendevent /dev/input/event1 3 52 0
sendevent /dev/input/event1 3 50 0
sendevent /dev/input/event1 0 2 0
sendevent /dev/input/event1 3 57 1
sendevent /dev/input/event1 3 53 83
sendevent /dev/input/event1 3 54 202
sendevent /dev/input/event1 3 48 0
sendevent /dev/input/event1 3 49 0
sendevent /dev/input/event1 3 52 0
sendevent /dev/input/event1 3 50 0
sendevent /dev/input/event1 0 2 0
sendevent /dev/input/event1 0 0 0
sendevent /dev/input/event1 3 57 0
sendevent /dev/input/event1 3 53 248
sendevent /dev/input/event1 3 54 164
sendevent /dev/input/event1 3 48 0
sendevent /dev/input/event1 3 49 0
sendevent /dev/input/event1 3 52 0
sendevent /dev/input/event1 3 50 0
sendevent /dev/input/event1 0 2 0
sendevent /dev/input/event1 3 57 1
sendevent /dev/input/event1 3 53 83
sendevent /dev/input/event1 3 54 202
sendevent /dev/input/event1 3 48 0
sendevent /dev/input/event1 3 49 0
sendevent /dev/input/event1 3 52 0
sendevent /dev/input/event1 3 50 0
sendevent /dev/input/event1 0 2 0
sendevent /dev/input/event1 0 0 0
sendevent /dev/input/event1 3 57 0
sendevent /dev/input/event1 3 53 248
sendevent /dev/input/event1 3 54 164
sendevent /dev/input/event1 3 48 0
sendevent /dev/input/event1 3 49 0
sendevent /dev/input/event1 3 52 0
sendevent /dev/input/event1 3 50 0
sendevent /dev/input/event1 0 2 0
sendevent /dev/input/event1 3 57 1
sendevent /dev/input/event1 3 53 83
sendevent /dev/input/event1 3 54 202
sendevent /dev/input/event1 3 48 0
sendevent /dev/input/event1 3 49 0
sendevent /dev/input/event1 3 52 0
sendevent /dev/input/event1 3 50 0
sendevent /dev/input/event1 0 2 0
sendevent /dev/input/event1 0 0 0

gianmaxfactor said:
Hi, thanks for the wonderful script. I get it working.
Now that I can simulate the "tap", I would like to know how to modify my script to obtain a "double tap" and a "long tap".
Thanks in advance.
PS.: This is my tap at x=248,y=164
Click to expand...
Click to collapse
Either copy paste the 4 lines that appear on every touch twice (double tap) or once and put a "sleep 1" between the first two and the last two (long press).
You can also use something like this:
Code:
# double tap
input tap 248 164
input tap 248 164
# long press
input swipe 248 164 248 164 1000
# help on the input command
input

Input tap and input swipe would be marvelous... but unfortunately I'm on android 2.3.6. In fact I imagine that swipe will be almost impossible.
Anyway, why do you talk about "4 lines" ? I see dozens of lines... what are the four I have to duplicate?

gianmaxfactor said:
Input tap and input swipe would be marvelous... but unfortunately I'm on android 2.3.6. In fact I imagine that swipe will be almost impossible.
Anyway, why do you talk about "4 lines" ? I see dozens of lines... what are the four I have to duplicate?
Click to expand...
Click to collapse
It's four on my old device, might be more for you. Basically, X lines are repeated every time you make a click. See which.
BTW, did you try actually long pressing? The script should be able to simulate that, though you'll probably want to exaggerate the long press (e.g. 3 seconds instead of one).

GermainZ said:
It's four on my old device, might be more for you. Basically, X lines are repeated every time you make a click. See which.
BTW, did you try actually long pressing? The script should be able to simulate that, though you'll probably want to exaggerate the long press (e.g. 3 seconds instead of one).
Click to expand...
Click to collapse
I tried... but the output is so long that I am not able to copy it entirely. I think I could add something to your script to divert the output into a file. But I don't know where (and how)...

gianmaxfactor said:
I tried... but the output is so long that I am not able to copy it entirely. I think I could add something to your script to divert the output into a file. But I don't know where (and how)...
Click to expand...
Click to collapse
Run the script. Tap *once*. Wait for ~5s. Cancel the action. In the outputted script, you'll see a line that says something like "sleep 5" - everything before it should be the tap, everything after garbage..

GermainZ said:
BTW, did you try actually long pressing? The script should be able to simulate that, though you'll probably want to exaggerate the long press (e.g. 3 seconds instead of one).
Click to expand...
Click to collapse
Incredibly there is a continuos flow of events while longpressing... dozens and dozens of quickly repeating actions... so there is no "sleep" in the output of the script. Every device is a world apart ! Thanks anyway... I've been a big help from you ! Bye

I used option one
I set to record 4
Nothing happens
O tried 500
Same result
Edit
OK that was vague
It does countdown
Then goes blank
No output no matter what I do

Related

[Q] Gallery hangs my Defy with CM7

Hi,
when I open Gallery my Defy hangs.
Looking CPU usage (via ADB) I see that the gallery process takes almost all the CPU.
So I tried with different gallery substitutes (ie Photo Gallery). Same behavior.
So I think it's not gallery fault, but something lower. Maybe some problem with the SD card or the codec for some media file.
I checked the Sd but everything seems fine (anyway I got the problem only when media directory is 'indexed').
I saw some work by szipinf.
Is there a way to trace (maybe via ADB) what is doing the hanging process?
Killing the process doesn't solve the problem (I saw that some system process where closed after sometime).
Same problem but also nowhere on solution.
Send from my gio .
just trying to get a workable flexible phone
I found a workaround!!!!
Connect your device with adb (I use adb over wifi) and verify that your CPU is normal.
Code:
adb connect 192.168.0.3:8000
adb shell
top
The "top" command prints cpu usage every 5 seconds or so.
Scroll up and take a look at the first line.
You should read low values for User and System % (mine is "User 0%, System 5%")
Start gallery on your device, now you should see the cpu usage very high, say over 90% for user.
The first process listed is the one hogging your cpu.
Code:
User 93%, System 5%, IOW 0%, IRQ 0%
User 292 + Nice 0 + Sys 16 + Idle 0 + IOW 0 + IRQ 3 + SIRQ 0 = 311
PID CPU% S #THR VSS RSS PCY UID Name
5243 93% S 12 122920K 31264K fg app_209 com.littlefatfish.photo
The name of the process could vary (say com.cooliris.media).
Write down the PID (in this case 5243).
Hit CTRL+C, adb exit.
Launch adb and take a look at the files held by this process, issuing
Code:
adb shell
ls -l /proc/5243/fd
In the list you should see only one media file, the one that is blocking the gallery!!!
In my case it was
/mnt/sdcard/DoveConviene_icons/[email protected]png
Now you have to remove this file (if is important for you, you should copy elsewhere).
rm /mnt/sdcard/DoveConviene_icons/[email protected]
My gallery now it's back to normality!!!!! (at least till another png will block it)

[HOW TO] Tweak your touchscreen [update: 11/04/12]

NOTE: The first six posts are a reply to the old post that I removed long ago.
I shouldn't have removed it completely.
Click to expand...
Click to collapse
This is the current configuration of the touchscreen:
Code:
=========== [TSP] Configure SET for normal ============
=== set_power - GEN_POWERCONFIG_T7 ===
0. idleacqint= 64, 1. actvacqint=255, 2. actv2idleto= 50
=== set_acquisition - GEN_ACQUIRECONFIG_T8 ===
0. chrgtime= 10, 1. reserved= 0, 2. tchdrift= 5
3. driftst= 1, 4. tchautocal= 0, 5. sync= 0
6. atchcalst= 9, 7. atchcalsthr= 27
=== [COLOR="Green"][B]set_touchscreen[/B][/COLOR] - TOUCH_MULTITOUCHSCREEN_T9 ===
0. ctrl=143, 1. xorigin= 0, 2. yorigin= 0
3. xsize= 18, 4. ysize= 11, 5. akscfg= 1
6. blen= 16, 7. tchthr= 32, 8. tchdi= 2
9. orientate= 1, 10.mrgtimeout= 0, 11.movhysti= 3
12.movhystn= 1, [COLOR="Red"][B]13[/B][/COLOR][B].movfilter= [/B][COLOR="Blue"][B]46[/B][/COLOR], 14.numtouch= 5
15.mrghyst= 5, 16.mrgthr= 40, 17.tchamphyst= 10
18.xrange=799, 19.yrange=479, 20.xloclip= 0
21.xhiclip= 0, 22.yloclip= 0, 23.yhiclip= 0
24.xedgectrl= 0, 25.xedgedist= 0, 26.yedgectrl= 0
27.yedgedist= 0, 28.jumplimit= 18
=== set_keyarray - TOUCH_KEYARRAY_T15 ===
0. ctrl=131, 1. xorigin= 16, 2. yorigin= 11
3. xsize= 2, 4. ysize= 1, 5. akscfg= 1
6. blen= 0, 7. tchthr= 45, 8. tchdi= 4
=== set_grip - PROCI_GRIPFACESUPRESSION_T20 ===
0. ctrl= 19, 1. xlogrip= 0, 2. xhigrip= 0
3. ylogrip= 5 4. yhigrip= 5, 5. maxtchs= 0
6. reserved= 0, 7. szthr1= 30, 8. szthr2= 20
9. shpthr1= 4 10.shpthr2= 15, 11.supextto= 10
=== set_noise ===
0. ctrl = 135, 1. gcaful(2bts)=0
2. gcafll(2bts)= 0, 3. actvgcafvalid =3
4. noisethr= 27, 5.freqhopscale= 0,6. freq[0]= 29
7. freq[1]= 34, 8. freq[2]= 39, 9. freq[3]= 49
10.freq[4]= 58, 11.idlegcafvalid= 3
=== set_total ===
0 , linearization_config.ctrl = 0
1 , twotouch_gesture_config.ctrl = 0
2 , onetouch_gesture_config.ctrl = 0
3 , selftest_config.ctrl = 0
4. cte_config.ctrl= 0, 5. cte_config.cmd= 0
6. cte_config.mode= 2, 7. cte_config.idlegcafdepth= 16
8. cte_config.actvgcafdepth= 63, 9.cte_config.voltage= 60
================= end ======================
To change it you simply need to run few commands:
Code:
echo [COLOR="Red"][B]13[/B][/COLOR][COLOR="Blue"]0[B]46[/B][/COLOR] > /sys/touchscreen/[COLOR="Green"][B]set_touchscreen[/B][/COLOR]
XX is the number of the option. In this example 13=movfilter.
YYY is the value you want to set. In this case 46. You must use 3 digits.
set_touchscreen is the file where you store this information. It's not always set_touchscreen, it could also be set_noise, set_acquisition etc...
To apply the changes you have to run this:
Code:
cat /sys/touchscreen/set_write
To get the new configuration run
Code:
dmesg
This will output a lot of kernel messages, not only the touchscreen configuration.
If you want to get the default configuration: reboot, 'cat /sys/touchscreen/set_write' and then 'dmesg'.
That's it.
Here some values explained: http://pastebin.com/raw.php?i=WSqjYT2t
Here a script with the default values, you can use it as base: http://pastebin.com/CejX00v5
The changes are not permanent, they are resetted on every boot. If you do something wrong, you can always reboot.
Don't put anything untested in /etc/init.d/
====
Here a i9000 script adapted for our phone.
Code:
#!/system/bin/sh
#Touchscreen
#Configure touchscreen sensitivity
#Sensitive(Chainfire)
echo 7035 > /sys/touchscreen/set_touchscreen;
echo 8002 > /sys/touchscreen/set_touchscreen; #default setting
echo 11000 > /sys/touchscreen/set_touchscreen;
echo 13060 > /sys/touchscreen/set_touchscreen;
echo 14005 > /sys/touchscreen/set_touchscreen; #default setting
cat /sys/touchscreen/set_write;
Default values (you can also reboot the phone):
Code:
#!/system/bin/sh
#Touchscreen
#Configure touchscreen sensitivity
#Sensitive - default settings
echo 7032 > /sys/touchscreen/set_touchscreen;
echo 8002 > /sys/touchscreen/set_touchscreen;
echo 11003 > /sys/touchscreen/set_touchscreen;
echo 13046 > /sys/touchscreen/set_touchscreen;
echo 14005 > /sys/touchscreen/set_touchscreen;
cat /sys/touchscreen/set_write;
___________
Note
In different custom roms I saw this:
Code:
#!/system/bin/sh
#Touchscreen
#Configure touchscreen sensitivity
#Sensitive(Chainfire)
echo 7035 > /sys/class/touch/switch/set_touchscreen;
echo 8002 > /sys/class/touch/switch/set_touchscreen;
echo 11000 > /sys/class/touch/switch/set_touchscreen;
echo 13060 > /sys/class/touch/switch/set_touchscreen;
echo 14005 > /sys/class/touch/switch/set_touchscreen;
This script obviously is not for our phone, it doesn't work.
The touchscreen maximum scan speed of the AT42QT602240 it's 250Hz for 1 finger (one scan every 1/250 s --> 4ms per scan)
so it will always have delay while moving, maybe you can improve it to some extent but it's slow compared to rapid movements that can be made while drawing, but for normal use, it isn't noticeable.
More info about scanning speed results:
http://www.youtube.com/watch?v=vOvQCPLkPt4
i think MOVHYSTI it's there on purpose to prevent some unintentional rubbing.
You are right, thanks for the explanation.
I knew it was there for a reason, but I still prefer as it is now. As you said, it's ok for normal use, playing games it's harder now.
Edit: with the original movfilter value, games are not that bad (I only tried Angry Birds), not that I care that much
I also want to add that the controller chip 4ms isn't final, the response that the microsoft research team it's showing it's for the whole loop (finger detected > drawed point on screen) and for that a lot of other times are need to take in account, for example screen refresh rate of our device (and most) takes about 17ms (60hz), so there is a need to improve hardware on the forthcoming devices.
this problem has been solved in ddkp3 version of indian firmware ! cus when i try doin this it moves instantly ! or is it cus of vurrut kernel ? i dono but the touchscreen is working great for me
Negative
I am on MIUI.
I tried your test.
But my screen moved instantaneously.
Probably I didn't explain what I mean well enough. Let's try this:
Put your finger on the screen and try to move it changing the coordinates of a single digit, not three, not five, just one. It's better if you do this in a single direction, try to keep still the X or the Y.
I doubt you can do this. And do this right after you put the finger on the screen, not after the coordinates already changed, becase after that the hysteresis automatically changes.
I know the change is instant even without this patch, I'm not talking about centimeters, inches (or whatever you use) and it's not to be intended in terms of time. I'm talking about pixels. This change is nothing revolutionary, we can't improve our hardware. Moreover the value that make me feel the change was movfilter, but in some situations the screen was hard to use, so I put back the original value.
I'm suggesting to remove the hysteresis because I think that every app applies a sort of movement filter that is coupled with it. With the updated values I can easly keep the screen still with my finger on it (with the first ones there were some microscillations).
Does anyone know why the screen sensitivity changes while plugged in?
The TSP thresold is intentionally increased, I don't want to change this, it's just a curiosity, because I couldn't find any exhaustive explanation.
I added two scripts (read the OP).
@rom cooks:
This is especially for you. Read the note in the first post.
How did you get the first configuration file ??
how can I view the current configuration ??
what do this improvement does ?
is it multitouch?
what is movfilter ???
vivekkalady said:
How did you get the first configuration file ??
how can I view the current configuration ??
Click to expand...
Click to collapse
Oh, I forgot to add this info.
Code:
cat /sys/touchscreen/set_write
dmesg
The first command set the current configuration and then use printk() to show it. To see "printk()" messages, you have to use the second command (dmesg). This will print a lot of kernel messages, not only the touchscreen configuration.
vivekkalady said:
what do this improvement does ?
Click to expand...
Click to collapse
It's like changing brightness/colours of your screen. There's no real improvement, it's up to you. I showed you a way to configure your touchscreen.
is it multitouch?
Click to expand...
Click to collapse
I don't understand what you mean.
You can change the number of finger tracked by the screen if you want (default 5, numtouch).
vivekkalady said:
what is movfilter ???
Click to expand...
Click to collapse
A parameter I used in the example above.
If you want to know what's its effect, well, try to change it.
Basically it changes how the screen reacts to movements. If you set it to a very low value, scrolling becomes very hard, the screen is like immovable.
I have problems scrolling trough homescreens. Sometimes I have to move my finger across the screen 3 times to scroll. And sometimes I want to scroll and accidentaly open an app. I hate it, I tried every rom and the only one that partially solve this was Cranium. I think this happend because the procesor have other priorities (conect wifi, download data package, send sms, etc) over the touchscreen.
juanmaper said:
I have problems scrolling trough homescreens. Sometimes I have to move my finger across the screen 3 times to scroll. And sometimes I want to scroll and accidentaly open an app. I hate it, I tried every rom and the only one that partially solve this was Cranium. I think this happend because the procesor have other priorities (conect wifi, download data package, send sms, etc) over the touchscreen.
Click to expand...
Click to collapse
ur touchscreen is probably DIRTY or has sum oily liquids on it ! clean it with a soft wet cloth several times and it'll go away ! i had that isue before
shriomman said:
ur touchscreen is probably DIRTY or has sum oily liquids on it ! clean it with a soft wet cloth several times and it'll go away ! i had that isue before
Click to expand...
Click to collapse
No dude, its a soft problem. Thanks anyway.
juanmaper said:
I have problems scrolling trough homescreens. Sometimes I have to move my finger across the screen 3 times to scroll. And sometimes I want to scroll and accidentaly open an app. I hate it, I tried every rom and the only one that partially solve this was Cranium. I think this happend because the procesor have other priorities (conect wifi, download data package, send sms, etc) over the touchscreen.
Click to expand...
Click to collapse
So this happens while you are doing other things, right?
If it's not because of some dirty on the screen, the only suggestions I could give you are:
try to change CPU governor
try to change I/O scheduler
try to convert your partitions in ext4 (Cranium used it if I'm not wrong)
See if this can help: http://forum.xda-developers.com/showthread.php?t=1137554
loSconosciuto said:
So this happens while you are doing other things, right?
If it's not because of some dirty on the screen, the only suggestions I could give you are:
try to change CPU governor
try to change I/O scheduler
try to convert your partitions in ext4 (Cranium used it if I'm not wrong)
See if this can help: http://forum.xda-developers.com/showthread.php?t=1137554
Click to expand...
Click to collapse
Im using lulzactive, and is a little more smoother, but time to time it happend that cannot scroll well.
loSconosciuto said:
Does anyone know why the screen sensitivity changes while plugged in?
The TSP thresold is intentionally increased, I don't want to change this, it's just a curiosity, because I couldn't find any exhaustive explanation.
Click to expand...
Click to collapse
+1. When plugged in the phone is really smooth.
I am also having the same problem... Especially in Swype keyboard... I think its a sensitivity problem...btw... Does a screen protector decreases or interfere with the sensitivity of the screen...?
landono5 said:
Does a screen protector decreases or interfere with the sensitivity of the screen...?
Click to expand...
Click to collapse
I don't know, I've never used one, but it's not unlikely.
You can increase the sensitivity with:
Code:
echo 7025 > /sys/touchscreen/set_touchscreen
cat /sys/touchscreen/set_write
Try different values.
If you go below ~10 your finger is detect even if you don't touch the screen. I suggest you not to use too low values here. (default=32)
landono5 said:
I am also having the same problem... Especially in Swype keyboard... I think its a sensitivity problem...btw...
Click to expand...
Click to collapse
I had problems with swype too. I had lags especially when the "suggestions bar" appeard/disappeared. Try this:
Swype settings->Word suggestion->tick everything
In this way it's less probable that the "suggestion bar" disappears.
Now, after a clean wipe and some tweaks, this problem seems almost gone and the setting I suggested does nothing in my case, but you can try.
landono5 said:
I am also having the same problem... Especially in Swype keyboard... I think its a sensitivity problem...btw... Does a screen protector decreases or interfere with the sensitivity of the screen...?
Click to expand...
Click to collapse
I have a screen protector and it doesnt interfere with the sensitivity. I think it depends on the protector. I have a cheap one, and its ok.
loSconosciuto said:
I don't know, I've never used one, but it's not unlikely.
You can increase the sensitivity with:
Code:
echo 7025 > /sys/touchscreen/set_touchscreen
cat /sys/touchscreen/set_write
Try different values.
If you go below ~10 your finger is detect even if you don't touch the screen. I suggest you not to use too low values here. (default=32)
I had problems with swype too. I had lags especially when the "suggestions bar" appeard/disappeared. Try this:
Swype settings->Word suggestion->tick everything
In this way it's less probable that the "suggestion bar" disappears.
Now, after a clean wipe and some tweaks, this problem seems almost gone and the setting I suggested does nothing in my case, but you can try.
Click to expand...
Click to collapse
Low values consume more battery, right?
juanmaper said:
Low values consume more battery, right?
Click to expand...
Click to collapse
I don't know, I use a value similar to the stock one. I put low values once for testing purpose only.
I suggested not to go below 10 because the touchscreen becomes almost unusable, it does things by itselfs.
loSconosciuto said:
I don't know, I use a value similar to the stock one. I put low values once for testing purpose only.
I suggested not to go below 10 because the touchscreen becomes almost unusable, it does things by itselfs.
Click to expand...
Click to collapse
I think the problem is not the sensitivity, its the number of times that the screen refresh the position of the finger. Because when I touch the screen just a bit, it work. But when trying to scroll, sometimes it dont.

[Q] How reliable is loadavg

From a shell:
Code:
$ cat /proc/loadavg
1.60 1.31 1.26 2/1446 19315
According to a.o.
https://www.centos.org/docs/5/html/5.2/Deployment_Guide/s2-proc-loadavg.html, 2/1446 means that I have 2 CPUs and 1446 tasks waiting to be run.
1446 tasks? On a heavily loaded workstation I seldom see more than a couple of 100 tasks. A simple server shows just over 100 tasks. So how come the Note has so many tasks? Besides,
Code:
$ps|wc -l
224
Given that I sometimes get load values of around 80 I start getting doubts that the numbers produced by /proc/loadavg are useful.
Does anyone have any ideas what could cause these high numbers for loads and tasks?
sciurius said:
Does anyone have any ideas what could cause these high numbers for loads and tasks?
Click to expand...
Click to collapse
Threads. Run "adb shell top -t" and you'll break out each thread:
Code:
User 31%, System 4%, IOW 0%, IRQ 0%
User 111 + Nice 297 + Sys 62 + Idle 828 + IOW 0 + IRQ 0 + SIRQ 0 = 1298
PID TID PR CPU% S VSS RSS PCY UID Thread Proc
3670 11496 2 22% R 504052K 49724K bg u0_a25 MediaScannerSer android.process.media
11192 11192 1 1% R 1792K 1164K shell top top
9091 9114 0 1% S 487544K 40000K bg u0_a170 Thread-416 com.mobidia.android.mdm:remote
2342 5579 3 1% S 701848K 101820K fg system Binder_D system_server
2342 2342 1 1% S 701848K 101820K fg system system_server system_server
2342 2430 0 0% S 701848K 101820K fg system ActivityManager system_server
2342 4431 1 0% S 701848K 101820K fg system Binder_A system_server
3957 4175 0 0% S 549604K 47424K bg u0_a16 NetworkLocation com.google.process.gapps
2342 3887 1 0% S 701848K 101820K fg system Binder_5 system_server
7563 7563 2 0% S 492308K 37216K fg u0_a39 ndroid.calendar com.google.android.calendar
2342 5594 2 0% S 701848K 101820K fg system Binder_E system_server
3555 3555 3 0% S 534276K 67664K fg u0_a121 ndroid.systemui com.android.systemui
2342 4165 1 0% S 701848K 101820K fg system Binder_6 system_server
690 690 0 0% S 0K 0K root ksmd
<snip>
I see. I'm used to applications that have one or two threads, but a typical Android app seems to have at least 10. That adds up quickly.

Watchmaker: Dynamically change opacity with time?

This has been driving me bananas because I can't seem to get it to work.
I want to gradually change the opacity of a layer between 0 and 100 over the course of 1 hour.
I thought setting the value of the opacity property using a counter might work, but it seems to just output a single value.
Any suggestions?
you can write a multi line script like
----------------------------------------------------------
if {dh11}==1 then var_my_opacity= 100
end
if ---- then ----var_my_opacity=50
end
.....
-----------------------------------------------------------
with all var hour ({dh11}) you want and all hour value (1,2,3, >3 and < 5)..... you want
and set you wanted item opacity to "var_my_opacity"
I think part of the problem is I found a bug in the lua interpreter. If I set opacity using a counter to vary between 0 to 100 in 10 seconds and reverse, I get the expected slowly flashing behavior.
{c_0_100_10_st}
But, if I do the same thing as part of a conditional:
({dh24}>=23) and {c_0_100_10_st} or 0
That statement just outputs a fixed value and stops.
Sent from my SM-N910T3 using XDA-Developers Legacy app
and why a "or 0" ?
1 or 0 = 1
0 or 0 = 0
so the "or" function with 0 do nothing.
and a "and" function give "0" only if one of the 2 member is "0", otherwise it is "1"
{dh24) never go up to 23. Hour go to 0 -> 23. So {dh24} can just reach 23 one time otherwise it is "0" from 0 to 22.
dersie said:
and why a "or 0" ?
1 or 0 = 1
0 or 0 = 0
so the "or" function with 0 do nothing.
and a "and" function give "0" only if one of the 2 member is "0", otherwise it is "1"
Click to expand...
Click to collapse
I think you have misunderstood the construct of the if / then command in LUA
pseudo code: If x=1 then y else z
is written thusly: (x==1) and y or z
Think of the brackets as the 'if' command, the 'and' as the 'then' command, and the 'or' as the 'else' command.

[GUIDE][ROOT] Increase microphone volume (also works in-call)

People always complained about not hearing me properly during phone calls, which obviously is due to the low microphone volume of my Moto Z.
This will temporarily or permanently (init.d) fix the low mic volume:
Temporary fix (does not survive reboot):
Open Terminal, type
Code:
su
tinymix 31 23
tinymix 32 27
tinymix 33 27
tinymix 34 27
tinymix 35 27
The second number represents the volume (range 0-31, default is 18 for #32-34, 16 for #31), you can change it at your will. I achieved good results with 27. Just use any voice recorder or call someone to check which volume fits best.
Thanks to @Rob2800 over at the Moto Z Play forums, who pointed this out: https://forum.xda-developers.com/moto-z-play/themes/how-to-increase-mic-sensitivity-t3739772
Permanent fix:
In order to survive a reboot, the values have to be changed in the system or better, be written at startup using init.d. If you ROM does support init.d, just place the following code inside a file and place it in /etc/init.d folder of your Moto Z. Change the second values as you wish (see above).
Code:
tinymix 31 23
tinymix 32 27
tinymix 33 27
tinymix 34 27
tinymix 35 27
Upon reboot check in terminal if the changes survived, e.g.:
Code:
su
tinymix 32
You now should see a response like
Code:
IN2L Volume: 27 (dsrange 0->31)
If not, try using this magisk module by @korom42, which enables init.d support on any device: https://forum.xda-developers.com/crossdevice-dev/sony/mod-simple-init-d-enabler-systemless-t3677750.
For me this works on latest AospExtended build.
Works on oreo (1650-03 Sheridan)

Categories

Resources