ONLY follow this instruction if your OS is Raspbian Jessie
We will install a xinput_calibrator and a script to load the calibration data each time X starts.
The first time you run X, you will be presented with a calibration screen. This will only run once, and you will be asked to touch the touchscreen a few times.
The calibration program will create a file which stores the calibration data( /etc/pointercal.xinput)
To perform calibration again, just delete /etc/pointercal.xinput and restart X. You will be presented again with the calibration program once X starts.
1.Install all the prerequisites required for calibration
sudo apt-get install libtool libx11-dev xinput autoconf libx11-dev libxi-dev x11proto-input-dev -y
2.Download and install xinput_calibrator
git clone https://github.com/tias/xinput_calibrator cd xinput_calibrator/ ./autogen.sh make sudo make install
When copying and pasting ./autogen.sh, you will need to confirm that the dot is copied
3.Download and setup the calibration script
cd ~ wget http://s3.amazonaws.com/ttbox/xinput_calibrator_pointercal.sh wget http://s3.amazonaws.com/ttbox/calibrator.desktop sudo cp ~/xinput_calibrator_pointercal.sh /etc/X11/Xsession.d/xinput_calibrator_pointercal.sh sudo cp ~/calibrator.desktop /etc/xdg/autostart/calibrator.desktop
When copying and pasting the last line above, you will need to confirm that all the quotes get copied correctly
[Menu] – [Preference] – [Calibrate Touchscreen]