pi@raspberrypi:~ $ sudo xinput_calibrator –list
Device “eGalax Inc. USB TouchController Touchscreen” id=6
Device “eGalax Inc. USB TouchController” id=7

pi@raspberrypi:~ $ sudo xinput_calibrator –device 6
Calibrating EVDEV driver for “eGalax Inc. USB TouchController Touchscreen” id=6
current calibration values (from XInput): min_x=156, max_x=3885 and min_y=3805, max_y=277

Doing dynamic recalibration:
Inverting X and/or Y axis…
Setting calibration data: 3877, 157, 276, 3774
–> Making the calibration permanent <–
copy the snippet below into ‘/etc/X11/xorg.conf.d/99-calibration.conf’ (/usr/share/X11/xorg.conf.d/ in some distro’s)
Section “InputClass”
Identifier “calibration”
MatchProduct “eGalax Inc. USB TouchController Touchscreen”
Option “Calibration” “3877 157 276 3774”
Option “SwapAxes” “0”
EndSection

The tricky part is, I had xorg.conf.d under /usr/share/X11 as indicated above had no effect. No matter how many times I tried to re-run the calibration it kept forgetting the calibration after reboot.

I copied 10-evdev.conf ile from /usr/share/X11/xorg.conf.d/ to /etc/X11/xorg.conf.d/ location. By the way I had to create the directory manually.

I added this section at the end of 10-evdev.conf. The file /etc/X11/xorg.conf.d/99-calibration.conf seems irrelevant for this Raspian distro.

Section “InputClass”
Identifier “calibration”
MatchProduct “eGalax Inc. USB TouchController”
Option “SwapXY” “0” # unless it was already set to 1
Option “InvertX” “1” # unless it was already set
Option “InvertY” “1” # unless it was already set
Option “Calibration” “156 3885 3805 277”
EndSection

I had an inverted USB touch panel. I had to play with the configuration for a while to get it up and running. The configuration above worked fine for me and my Raspberry remembers the correct alignment and calibration at startup.

Last modified: February 18, 2021

Author