Installation and Calibration
0. Determine your device. Find in your Xorg.log (/root/.Xorg.0.log) touchsceen device, it is /dev/input/event2 in my case. Matching by name should be also possible.
NOTE: be aware that when you connect USB keyboard, touchscreen device number can be changed.
1. install xf86-input-tslib
1.1 copy UDEV rules and Xorg conf. files. According to TSLIB README:
sudo cp 95-input-penmount-tslib.conf /etc/X11/xorg.conf.d
sudo cp 69-input-penmount.rules /etc/udev/rules.d
2. configure xorg (/etc/X11/xorg.conf)
Section "InputDevice"
Identifier "Penmount"
Driver "tslib"
Option "Device" "/dev/input/event2"
EndSection
3. Add transformation:
create /etc/pointercal containing:
0 1 0 1 0 0 1 3
It will provide axis swap.
The file contains coefficients: Txx Txy Ox Tyx Tyy Oy S Sum
V := (T*Vraw + O)/S, where V=[x y], or
X := (Txx*Xraw + Txy*Yraw + Ox )/S
Y := (Tyx*Xraw + Tyy*Yraw + Oy )/S
Sum - is a sum of all coefficients
4. Create a file: /etc/X11/xorg.conf.d/99-calibration.conf:
Section "InputClass"
Identifier "calibration"
MatchProduct "DIALOGUE INC PenMount USB"
Option "Calibration" "0 1000 0 1000"
EndSection
5. Run xinput_calibrator and copy sniplet generated by the program into 99-calibration file, e.g:
Section "InputClass"
Identifier "calibration"
MatchProduct "DIALOGUE INC PenMount USB"
Option "Calibration" "0 1000 0 1000"
Option "MinX" "30"
Option "MaxX" "4088"
Option "MinY" "13"
Option "MaxY" "4176"
Option "SwapXY" "0" # unless it was already set to 1
Option "InvertX" "0" # unless it was already set
Option "InvertY" "0" # unless it was already set
EndSection
Notes
1. You can observe data that comes from touchscreen in raw or transformed form by using ts_print or ts_printraw
2. You can manipulate transformation coefficients when you have no calibration
3. Be aware that tslib driver does not support "SwapAxis" option, but swapping is possible through transformation coefficients.
4. ts_calibrate hangs - don't use it.
References
1. PenMount - manufacturer of touchscreen controller chip
2. NexCom VTC-1000 platform
3. xinput_calibrator - software for calibration the touchscreen
Acknowlegments
1. Investigation was performed for Arynga,
2. Bartlomiej Jozwiak - thank you for building the RPM packages for Tizen.