Tuesday, October 3, 2017

Debian 9 touch screen calibration (ENG)


Touchscreen mouse calibration is tested for the following OS:


  • Description: Debian GNU/Linux 9.1 (stretch)
  • Release: 9.1
  • ernel: Linux 4.9.0-3-686-pae
  • Architecture: x86


For touch screen we can use libinput or evdev driver. Libinput replaces the evdev driver. The configuration below is created for evdev. In the other words We use evdev.


  • Get information about xserver-xorg-input.


dpkg -l | grep xserver-xorg-input


Result:




As we see there is no evdev driver.


  • Let's install evdev driver.

apt-get install xserver-xorg-input-evdev


  • Check if evdev driver is installed


dpkg -l | grep xserver-xorg-input


Result:







  • Check if configuration files are in /usr/share/X11/xorg.conf.d directory.


cd /usr/share/X11/xorg.conf.d ls

result:

 
10-amdgpu.conf 10-evdev.conf 10-quirks.conf 40-libinput.conf 70-wacom.conf


  • now remove libinput driver or we can just remove touch screen section from libinput driver configuration file.


in order to remove libinput driver with dependent packages:


 
apt-get remove --auto-remove xserver-xorg-input-libinput


in order to disable libinput touch scree:

open 40-libinput.conf and remove a touchscreen InputClass Section that is shown in image below.




  • now install xinput-calibrator



sudo apt-get install xinput-calibrator


  • Check if you need to swap axes. if you need to swap just run:


xinit set-int-prop "eGalax Inc." "Evdev Axes Swap" 8 1


  • Run calibrator to get correct x,y positions.

 
xinput_calibrator --output-type xinput

The result will be like this:





Now everything should be fine, but if we want to make calibration permanent (after system restart),  open 10-evdev.conf config, find touch screen section and add "Calibration" and "SwapAxes" entries.





If we don't want to touch evdev configuration we can run the folloing command after X11 load:


xinput set-prop "eGalax Inc." "Evdev Axis Calibration" 1543, 222, 409, 1582 xinput set-prop "eGalax Inc." "Evdev Axes Swap" 1
if you want to configure libinput instead of evdev, remove evdev driver and install lib input if the last one is removed:
dpkg -P xserver-xorg-input-evdev apt-get install xserver-xorg-input-libinput