Calibrate Touchscreen

From www.chip-community.org
Jump to: navigation, search

Install xinput-calibrator:

 sudo apt-get install xinput-calibrator

Run xinput_calibrator from the terminal, and follow the instructions on the screen. You should see a window like this (filling the screen).

Xinput calibrate pocketchip screenshot.png

Once you have touched the four points, the window will close and you should see something like the following program output in the terminal.

Calibrating EVDEV driver for "1c25000.rtp" id=6
	current calibration values (from XInput): min_x=3954, max_x=159 and min_y=3663, max_y=279

Doing dynamic recalibration:
	Setting calibration data: 3966, 139, 3610, 251
	--> 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	"1c25000.rtp"
	Option	"Calibration"	"3966 139 3610 251"
	Option	"SwapAxes"	"0"
EndSection

On Debian (the CHIP's OS), the file to put this in is "/usr/share/X11/xorg.conf.d/99-calibration.conf". Replace the contents of that file with the "Section" directive in the output (everything between and including "Section" and "EndSection"). The calibration will not take effect until you restart X.

Additional Customization

Some people like to performe right clicks with a tap and hold action. To achieve that, the EmulateThirdButton option can be enabled and configured. The setting belongs in the same InputClass section as the calibration, usually added at the end.

Section "InputClass"
	Identifier	"calibration"
	MatchProduct	"1c25000.rtp"
	Option	"Calibration"	your calibration here
	Option	"SwapAxes"	"0"

	Option "EmulateThirdButton" "1"
	Option "EmulateThirdButtonTimeout" "750"
	Option "EmulateThirdButtonThreshold" "30"
EndSection

Where the timeout is in milliseconds and the threshold is the maximum amount of move.