Linux – xinput calibrator (touchschreen kalibratie)
Met dit programma kan je een touchscreen kalibreren bijvoorbeeld op de Raspberry Pi.
Informatie (ENG):
xinput calibrator: A generic touchscreen calibration program for X.Org
Version: 0.7.5
Website: http://www.freedesktop.org/wiki/Software/xinput_calibrator
Source: http://github.com/tias/xinput_calibrator
Bugs: http://github.com/tias/xinput_calibrator/issues
Build instructions:
./autogen.sh
Sets up build environment, run ./autogen.sh –help to see the build options
Notable build options:
–with-gui=gtkmm Use gtkmm GUI
–with-gui=x11 Use native x11 GUI
make
Builds the software with the configured GUI
Usage:
——
Simply run:
xinput_calibrator
For more information, run with –help or check the manpage.
The scripts/ directory constains scripts to get calibration from hal or use a pointercal file to reapply xinput commands across reboots
More about the project:
Because all existing calibrators were driver dependent and hard to use, xinput_calibrator was created. The goal of xinput_calibrator is to:
* work for any Xorg driver (use Xinput to get axis valuators),
* output the calibration as Xorg.conf, HAL policy and udev rule,
* support advanced driver options, such as Evdev’s dynamic calibration,
* have a very intuitive GUI (normal X client).
Xinput_calibrator is based on a simple calibrator that was proposed on the Xorg mailinglist. The first release(v0.2.0) improved upon it by reading axis valuators from Xinput, hence making it generic for all touchscreen drivers. The announcement was done on the Xorg mailinglist, and the code is on Tias’ webpage.
Starting from v0.4.0, it writes Xorg.conf and (HAL) FDI policy file values, and contains a wrapper script to get axis valuator information for the evtouch driver (evtouch does not export the current calibration through its axis valuators). It is also the first program to support dynamic evdev calibration, by using its advanced Xinput functionality.
The v0.5.0 version is written entirely in the X window system, needing no external dependencies. Because of its modular structure, other frontends can be easily created too.
Version v0.6.0 has a proper build system and gained a lot of features thanks to the feedback of different users.
Version 0.7.0 has mis-click detection and proper packaging support: proper make dist, one binary, has manpage, menu entry and icon. DEB and RPM package meta-data in their respective VCS branches.
Voorbeeld compileren
1) Voordat je kan compileren is eerst wat software nodig, installeer deze met het commando:
sudo apt-get install git libncurses5 libncurses5-dev qt4-dev-tools build-essential
1B) Op de stretch van 2018 moet je ook xi installeren:
sudo apt-get -y install libxi-dev
2) Download xinput_calibrator met het volgende commando:
wget http://github.com/downloads/tias/xinput_calibrator/xinput_calibrator-0.7.5.tar.gz
3) Pak het bestand uit met: tar xvfz xinput_calibrator-0.7.5.tar.gz
4) Ga naar de folder: cd xinput_calibrator-0.7.5
5) Kijk of alle benodigdheden er zijn: ./configure
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
pi@raspberrypi:~/xinput_calibrator-0.7.5 $ ./configure checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for style of include used by make... GNU checking dependency style of gcc... gcc3 checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking build system type... armv7l-unknown-linux-gnueabi checking host system type... armv7l-unknown-linux-gnueabi checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for ar... ar checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking whether we are using the GNU C++ compiler... (cached) yes checking whether g++ accepts -g... (cached) yes checking dependency style of g++... (cached) gcc3 checking how to run the C++ preprocessor... g++ -E checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for ld used by g++... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC -DPIC checking if g++ PIC flag -fPIC -DPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking for X... libraries , headers checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for stdbool.h that conforms to C99... yes checking for _Bool... yes checking for working strtod... yes checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for XINPUT... yes checking for XI_PROP... yes checking gui... default checking for GTKMM... no checking for X11... yes checking for XRANDR... no configure: creating ./config.status config.status: creating Makefile config.status: creating scripts/Makefile config.status: creating src/Makefile config.status: creating src/calibrator/Makefile config.status: creating src/gui/Makefile config.status: creating man/Makefile config.status: executing depfiles commands config.status: executing libtool commands |
6) Compileer de source: make
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
pi@raspberrypi:~/xinput_calibrator-0.7.5 $ make Making all in src make[1]: Entering directory '/home/pi/xinput_calibrator-0.7.5/src' Making all in calibrator make[2]: Entering directory '/home/pi/xinput_calibrator-0.7.5/src/calibrator' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/home/pi/xinput_calibrator-0.7.5/src/calibrator' Making all in gui make[2]: Entering directory '/home/pi/xinput_calibrator-0.7.5/src/gui' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/home/pi/xinput_calibrator-0.7.5/src/gui' make[2]: Entering directory '/home/pi/xinput_calibrator-0.7.5/src' g++ -DPACKAGE_NAME=\"xinput_calibrator\" -DPACKAGE_TARNAME=\"xinput_calibrator\" -DPACKAGE_VERSION=\"0.7.5\" -DPACKAGE_STRING=\"xinput_calibrator\ 0.7.5\" -DPACKAGE_BUGREPORT=\"http://github.com/tias/xinput_calibrator/issues\" -DPACKAGE_URL=\"http://www.freedesktop.org/wiki/Software/xinput_calibrator\" -DPACKAGE=\"xinput_calibrator\" -DVERSION=\"0.7.5\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -DHAVE_XI_PROP=1 -I. -Wall -ansi -pedantic -Wmissing-declarations -g -O2 -MT xinput_calibrator-main_x11.o -MD -MP -MF .deps/xinput_calibrator-main_x11.Tpo -c -o xinput_calibrator-main_x11.o `test -f 'main_x11.cpp' || echo './'`main_x11.cpp In file included from main_common.hpp:108:0, from main_x11.cpp:23: calibrator/calibratorUsbtouchscreen.cpp: In member function ‘void CalibratorUsbtouchscreen::read_int_parameter(const char*, int&)’: calibrator/calibratorUsbtouchscreen.cpp:77:13: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable] int dummy; ^ calibrator/calibratorUsbtouchscreen.cpp: In member function ‘void CalibratorUsbtouchscreen::read_bool_parameter(const char*, bool&)’: calibrator/calibratorUsbtouchscreen.cpp:92:15: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable] char *dummy; ^ main_x11.cpp: In function ‘int main(int, char**)’: main_x11.cpp:37:12: warning: deleting object of abstract class type ‘Calibrator’ which has non-virtual destructor will cause undefined behaviour [-Wdelete-non-virtual-dtor] delete calibrator; ^ mv -f .deps/xinput_calibrator-main_x11.Tpo .deps/xinput_calibrator-main_x11.Po /bin/bash ../libtool --tag=CXX --mode=link g++ -Wall -ansi -pedantic -Wmissing-declarations -g -O2 -o xinput_calibrator xinput_calibrator-main_x11.o -lX11 -lXext -lXi -lX11 libtool: link: g++ -Wall -ansi -pedantic -Wmissing-declarations -g -O2 -o xinput_calibrator xinput_calibrator-main_x11.o -lXext -lXi -lX11 make[2]: Leaving directory '/home/pi/xinput_calibrator-0.7.5/src' make[1]: Leaving directory '/home/pi/xinput_calibrator-0.7.5/src' Making all in man make[1]: Entering directory '/home/pi/xinput_calibrator-0.7.5/man' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/home/pi/xinput_calibrator-0.7.5/man' Making all in scripts make[1]: Entering directory '/home/pi/xinput_calibrator-0.7.5/scripts' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/home/pi/xinput_calibrator-0.7.5/scripts' make[1]: Entering directory '/home/pi/xinput_calibrator-0.7.5' make[1]: Nothing to be done for 'all-am'. make[1]: Leaving directory '/home/pi/xinput_calibrator-0.7.5' |
7) Installeer de binairy: sudo make install
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
Making install in src make[1]: Entering directory '/home/pi/xinput_calibrator-0.7.5/src' Making install in calibrator make[2]: Entering directory '/home/pi/xinput_calibrator-0.7.5/src/calibrator' make[3]: Entering directory '/home/pi/xinput_calibrator-0.7.5/src/calibrator' make[3]: Nothing to be done for 'install-exec-am'. make[3]: Nothing to be done for 'install-data-am'. make[3]: Leaving directory '/home/pi/xinput_calibrator-0.7.5/src/calibrator' make[2]: Leaving directory '/home/pi/xinput_calibrator-0.7.5/src/calibrator' Making install in gui make[2]: Entering directory '/home/pi/xinput_calibrator-0.7.5/src/gui' make[3]: Entering directory '/home/pi/xinput_calibrator-0.7.5/src/gui' make[3]: Nothing to be done for 'install-exec-am'. make[3]: Nothing to be done for 'install-data-am'. make[3]: Leaving directory '/home/pi/xinput_calibrator-0.7.5/src/gui' make[2]: Leaving directory '/home/pi/xinput_calibrator-0.7.5/src/gui' make[2]: Entering directory '/home/pi/xinput_calibrator-0.7.5/src' make[3]: Entering directory '/home/pi/xinput_calibrator-0.7.5/src' test -z "/usr/local/bin" || /bin/mkdir -p "/usr/local/bin" /bin/bash ../libtool --mode=install /usr/bin/install -c xinput_calibrator '/usr/local/bin' libtool: install: /usr/bin/install -c xinput_calibrator /usr/local/bin/xinput_calibrator make[3]: Nothing to be done for 'install-data-am'. make[3]: Leaving directory '/home/pi/xinput_calibrator-0.7.5/src' make[2]: Leaving directory '/home/pi/xinput_calibrator-0.7.5/src' make[1]: Leaving directory '/home/pi/xinput_calibrator-0.7.5/src' Making install in man make[1]: Entering directory '/home/pi/xinput_calibrator-0.7.5/man' make[2]: Entering directory '/home/pi/xinput_calibrator-0.7.5/man' make[2]: Nothing to be done for 'install-exec-am'. test -z "/usr/local/share/man/man1" || /bin/mkdir -p "/usr/local/share/man/man1" /usr/bin/install -c -m 644 xinput_calibrator.1 '/usr/local/share/man/man1' make[2]: Leaving directory '/home/pi/xinput_calibrator-0.7.5/man' make[1]: Leaving directory '/home/pi/xinput_calibrator-0.7.5/man' Making install in scripts make[1]: Entering directory '/home/pi/xinput_calibrator-0.7.5/scripts' make[2]: Entering directory '/home/pi/xinput_calibrator-0.7.5/scripts' make[2]: Nothing to be done for 'install-exec-am'. test -z "/usr/local/share/pixmaps" || /bin/mkdir -p "/usr/local/share/pixmaps" /usr/bin/install -c -m 644 xinput_calibrator.svg xinput_calibrator.xpm '/usr/local/share/pixmaps' test -z "/usr/local/share/applications" || /bin/mkdir -p "/usr/local/share/applications" /usr/bin/install -c -m 644 xinput_calibrator.desktop '/usr/local/share/applications' make[2]: Leaving directory '/home/pi/xinput_calibrator-0.7.5/scripts' make[1]: Leaving directory '/home/pi/xinput_calibrator-0.7.5/scripts' make[1]: Entering directory '/home/pi/xinput_calibrator-0.7.5' make[2]: Entering directory '/home/pi/xinput_calibrator-0.7.5' make[2]: Nothing to be done for 'install-exec-am'. make[2]: Nothing to be done for 'install-data-am'. make[2]: Leaving directory '/home/pi/xinput_calibrator-0.7.5' make[1]: Leaving directory '/home/pi/xinput_calibrator-0.7.5' |
Download xinput_calibrator @ github.com
[#/software/xinput_calibrator” ]