Sunday, April 26, 2009

Evtouch configuration

This article is mainly for Tablet Classmate PC.

Evtouch is a Xorg (X window system) input driver for touchscreen device with Linux kernel input/event driver. For example some USB touchscreen device with USBHID class.

To use evtouch Xorg driver, xorg should be setup as follow:


--------------------------------------------------------------------------------
Section "InputDevice"
Identifier "TOUCH"
Driver "evtouch"
Option "Device" "/dev/input/by-path/pci-0000:00:1d.3-usb-0:1:1.0-event-"

Option "DeviceName" "touchscreen"
Option "ReportingMode" "Raw"
Option "MoveLimit" "10"
Option "SendCoreEvents" "On"
# Option "Calibrate" "1"
Option "MinX" "1"
Option "MinY" "1"
Option "MaxX" "4090"
Option "MaxY" "4090"
Option "x0" "-6"
Option "y0" "8"
Option "x1" "1"
Option "y1" "2"
Option "x2" "12"
Option "y2" "2"
Option "x3" "5"
Option "y3" "3"
Option "x4" "-6"
Option "y4" "3"
Option "x5" "-4"
Option "y5" "3"
Option "x6" "0"
Option "y6" "5"
Option "x7" "1"
Option "y7" "5"
Option "x8" "1"
Option "y8" "5"
EndSection

Section "ServerLayout"
......
InputDevice "TOUCH"
EndSection
--------------------------------------------------------------------------------


Calibrate by hand


Evtouch comes with a calibration utility. It works, but I find the result is not very accurate. In fact it can be calibrated further by editing xorg.conf directly.

  • If you find when you touch the margin of the screen, the cursor is not at margin, you can change the "MinX", "MinY", "MaxX", "MaxY" in xorg.conf to calibrate.
  • The x0-y0 to x9-y9 corresponds to 9 regions on screen, with the x0-y0 at the left-bottom corner, x2-y0 at the right-bottom corner, x9-y9 at the right-top corner. To calibrate the touch screen in the region, just the values of corresponding options.

Rotate screen


To rotate screen:
xrandr --output LVDS --rotate left

evtouch should have supported rotation automatically. But the evtouch-0.8.7 in my debian does not work. I write a small patch 08__fix_rotate.patch to fix this issue.

Suspend and Resume


My touchscreen device is a usb device. This means it will be removed by Linux kernel before suspend and re-plugged after resume. Evtouch xorg driver has suspend and resume support mechansim, but it does not work sometimes. From the error message in /var/log/Xorg.0.log, it seems that the underlaying usb kernel device is not ready when evtouch xorg driver is being initialized. Fortunatally, it works sometimes. So if it your touchscreen does not work after resume, just go suspend again and hope it works after next resume.

Right Button


I am not successful in configuring right button. Maybe a kernel input driver issue, usbhid can not report BTN_TOUCHED for my device. But it seems that the following configuration should work for correct kernel input drivers.


--------------------------------------------------------------------------------
Section "InputDevice"
Identifier "TOUCH"
Driver "evtouch"
......
Option "longtouched_action" "down"
Option "longtouched_button" "3"
EndSection
--------------------------------------------------------------------------------

1 comment:

Anto said...

hello, I'm working with a elo touchscreen. I have some questions:

1) What is de difference betwen driver evtouch and elographics?? I have prove with elographics with more problems.

2)Can you explain exactly what is the function of the x1,x2,x3,..y1,y2,y3 params ??

Thnks