Saturday 30 July 2016

touchscreen calibration and some other (related?) things

Backstory (because context is always nice)



Before I got my ZenFone2 I was using a samsung galaxy s2 as my main phone.
It was a really nice phone and became even better after some small modifications such as attaching a bluetooth keyboard to it and converting the touchscreen to a touchpad (like those things on laptops). With a chroot linux installation it actually felt like a pocket computer. However it had rather low processing power and very little ram and a small screen with a low resolution. The zf2 with its good specs and x86_64 would be much better suited to be truly a pc in the pocket....


So I wanted to make the touchscreen on the zf2 behave like a touchpad.
According to this, I only need to change 1-2 lines in an .idc file.
This worked well on the sgs2 (filename:sec_touchscreen.idc) but on the zf2, there is no such file.

After looking through a bit of kernel code, I found out that the file should be called "ftxxxx_ts.idc".
After creating the file you can start to calibrate the behaviour of the touchscreen.
This might be helpful: https://source.android.com/devices/i...h-devices.html

touchscreen --> touchpad



Here are the basic steps of making the touchscreen behave like a touchpad.
Simply run these commands in a root shell

Code:


echo "touch.deviceType = pointer" >> /system/usr/idc/ftxxxx_ts.idc
echo "touch.gestureMode = spot" >> /system/usr/idc/ftxxxx_ts.idc
chmod 544 /system/usr/idc/ftxxxx_ts.idc
chown 0:0 /system/usr/idc/ftxxxx_ts.idc


or add these two lines manually to the file (also create if it doesn't exist).

Code:


touch.deviceType = pointer
touch.gestureMode = spot


Make sure the permissions are correct (544 or rwrr).
ALSO IMPORTANT: Make sure that there are no mistakes in the code before running it (because I might have mistyped something....but I don't think so).
(Soft-)Reboot for the changes to take effect.



touchscreen <-- touchpad



To revert the changes, you can delete the file or change

Code:


touch.deviceType = pointer

to

Code:


touch.deviceType = touchscreen

You can also comment out the line.

Code:


#touch.deviceType = pointer

This should make it behave like a touchscreen again.



What next:



I still need to find a way to change between touchscreen and touchpad mode on the fly without doing the editing and rebooting.
Maybe an xposed module could do this, but I have not found one and I have no idea how to write one.
Therefore.....If anyone knows how to do this, please help.

No comments:

Post a Comment