Watchmaker: Dynamically change opacity with time? - Samsung Gear S3

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.

Related

20xxx registry settings not discussed so far

While poking around 20954, and comparing it to the stock fuze build 19971 or whatever it is, I noticed that at some point in the 20xxx series there were several registry keys added pertaining to In-Call recording, tried fiddling with them a bit but don't see anything specific kicking in.. maybe someone else wants to tinker!
Code:
[HKEY_LOCAL_MACHINE\System\AudioRecording]
"Enabled"=dword:1
[HKEY_CURRENT_USER\Software\Microsoft\Voice]
"AllowInCallRecording"=dword:1
"EnableCallRecordMenuItem"=dword:1
I might be wrong on the HKLM\HKCU parts, try adding them to both.. no idea where the menu option is supposed to show up either, but i'd assume the dialer since it's cprog.exe that checks for these
Also, there are new keys in the 20xxx series pertaining to Gestures, which are now supported by WinMo itself, mimicing some of the features available in HTC's TouchFlo (and probably performing better, too, )
Code:
[HKEY_CURRENT_USER\ControlPanel\Gestures\Touch]
"Disabled"=dword:0 ; 0 for disabled, allows multi-select, 1 for enabled, doesn't work so hot with multi-select
"ScrollFriction" ; unknown default value or units
"ScrollInterval" ; unknown default value or units
"Multiplier" ; unknown default value or units
"Length" ; unknown default value or units
"Multiplier" ; unknown default value or units
"Tolerance" ; unknown default value or units
"Timeout" ; unknown default value or units
[HKEY_LOCAL_MACHINE\SYSTEM\GWE\TouchFilter]
"FastestTapTime" ; unknown default value or unit of measure, guess=units in ms
"MaxTapSpan" ; unknown default value or unit of measure, guess=units in pixels
"MaxTouchFilterDelay" ; unknown default value or unit of measure, guess=units in ms
More new stuff:
Code:
[HKEY_LOCAL_MACHINE\SYSTEM\GDI\GLYPHCACHE]
"Limit0"=dword:12000 ; unknown, "limit" key controls font cache, limit0 may be a secondary font cache or..?
[HKEY_LOCAL_MACHINE\ControlPanel\Power]
"DynamicChargeicon"=dword:1 ; set to 0 for normal "plugged in" icon when on ac/usb power, set to 1 for blinking battery icon to indicate charging
[HKEY_CURRENT_USER\ControlPanel\Phone]
"EnableTextResponse"=dword:1 ; unknown
"DisableGSMNetworkSelection"=dword:0 ; unknown, but you can guess from its name
[HKEY_LOCAL_MACHINE\Software\Microsoft\SIClnt]
"ShowAllSIPopups"=dword:1 ; imagine this has something to do with SI/SL messages from provider, see http://msdn.microsoft.com/en-us/library/ms890494.aspx
"HideMediumSIPopups"=dword:0 ; see above
[HKEY_LOCAL_MACHINE\System\Inbox\Settings]
"ShowReplySMSSK1"=dword:1 ; unknown
"MsgClassMenuOrder" ; unknown default or units of mesaure
[HKEY_LOCAL_MACHINE\System\Inbox\Settings\OEM]
"CustomEventHandler" ; unknown
[HKEY_LOCAL_MACHINE\Software\Microsoft\Inbox\Settings]
"ReminderAllDay"=dword:1 ; unknown
[HKEY_LOCAL_MACHINE\System\Inbox\AutoConfiguration]
"DefaultDestinationNetworkGUID" ; unknown, probably directs sms/mms/email to use a specific connection (i.e. wap.cingular vs. ims.cingular vs. isp.cingular) - value is most likely a string that matches the connection GUID
[HKEY_CURRENT_USER\Software\Microsoft\Inbox]
"DisableAutoSSL"=dword:0 ; unknown
[HKEY_LOCAL_MACHINE\Software\Microsoft\Pim\Contacts]
"SIMNewContact" ; unknown
[HKEY_LOCAL_MACHINE\Comm\Tcpip\Parms]
"TcpRttVarAdjustment" ; unknown, probably a dynamic RTT prediction
"TcpSmoothRttAdjustment" ; see above, probably toggle dword 0/1
If a value doesn't work, try swapping HKCU for HKLM and vice versa, I jotted these down as I was going along looking for other things, and left that part off
New sound category:
Code:
[HKEY_CURRENT_USER\ControlPanel\Sounds\CallStart]
IE Mobile 6:
Code:
[HKEY_LOCAL_MACHINE\Security\Internet Explorer]
"MSHTML"=dword:0 ; 0 for old IE, 1 for IE Mobile 6
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Settings]
"Always Use My Font Size"=dword:1 ; overrides absolute font sizes on webpages, uses menu setting for font sizes
Prototype UI? Removes the start button and x button..
Code:
[HKEY_LOCAL_MACHINE\Adaptation]
"PROTOTYPE"=dword:1
yah ive seen that "record call" option in monx's roms..doesnt work but has a start and a stop option in the pop up righ softkey menu while in the dialer..
Does he get the record call option from the same registry edits or another method?
not sure..ill pm him or you can if you want
bump for IE 6 Mobile toggle
bump for prototype UI
Bump for a useful IE Mobile 6 key that makes xda-devs alot easier to read on ie mobile 6:
Code:
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Settings]
"Always Use My Font Size"=dword:1 ; overrides absolute font sizes on webpages, uses menu setting for font sizes
[HKEY_LOCAL_MACHINE\Adaptation]
"PROTOTYPE"=dword:1
this was not present for me in 20954, and doesn't do anything when added.... I tried in HKCU too...
Search for string "PROTOTYPE" type unicode in \SYS\Shell\shell32.exe\S000
If you don't have it, you must have a different version of 20954 than me? Works here (note it needs a soft reset)
in Comm Manager, turning 3G Icon "OFF" will activate GPRS only.. whereas turning it "ON" will make it to Auto.. can u pls advise me how to make it 3G only instead of Auto when turning it "ON"?
coz i want to 'force' my device to use 3G only in my area.thx
comm manager is written by htc, not microsoft, and thus is outside the scope of this thread.

All dev must read! Important build.prop info!

I would assume this is the rightt place to post this...
Time and time again, i see devs putting in DUPLICATE lines in build.props....
THEY CANCEL EACH OTHER OUT!!
THE BUILD.PROP GOES OFF THE FIRST ENTRY AND STICKS WITH IT
Therefore if your first lines are:
ro.ril.hsxpa = (2)
ro.ril.gprsclass = (10)
and if you have it a couple pages down in your build.prop as:
ro.ril.hsxpa = (3)
ro.ril.gprsclass = (12)
IT GOES OFF THE FIRST ONES..
ro.ril.hsxpa = (2)
ro.ril.gprsclass = (10)
THEREFORE THE ONES AT THE END OF THE BUILD.PROP ARE NOT ACTIVE (NOT RECOGNIZED) !! ONLY THE FIRST ONES.
PLEASE CHECK YOUR BUILD.PROPS FOR DUPLICATES!!..
SOMETIMES THE LITTLE THINGS ARE THE BIGGEST THINGS...
I have noticed significant speed increase in data and speed when i delete the lower end values that are duplicates..

[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.

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

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

Categories

Resources