tias / xinput_calibrator Goto Github PK
View Code? Open in Web Editor NEWA generic touchscreen calibration program for X.Org
Home Page: http://www.freedesktop.org/wiki/Software/xinput_calibrator
License: Other
A generic touchscreen calibration program for X.Org
Home Page: http://www.freedesktop.org/wiki/Software/xinput_calibrator
License: Other
Whenever I try to run xinput_calibrator
I get this error:
xinput_calibrator: symbol lookup error: xinput_calibrator: undefined symbol: _ZNK5Cairo7Context16get_text_extentsERKSsR20cairo_text_extents_t
Hello! Thanks for great project and awesome work!
On my system i have dual head machine. And only one of it is covered with touchscreen, another head is not.
When i do run xinput_calibrate it create active area for whole virual desktop for booth screens. And i unable to calibrate my touchscreen because i unable to press dots on second monitor.
Good to have command line option to specify device & active screen.
When axes are swapped, the x11 calibrator crashes with a double free. This is because do_set_prop includes an XCloseDevice call, which should not be there.
I moved the call in calibratorEvdev.cpp do_set_prop to just after the second call in finish_data in that same file. Seems to work.
Help! Everytime I try to run xinput_calibrator I get:
Unable to connect to X server
I'm sure its something super easy, but I'm a noob so any help would be greatly appreciated!
Hello, I am very much a noob to the world of code so I apologize if this is an obvious question.
I git cloned the code and follow the build instructions listed in the readme.
It seems like the process didn't work, however, as typing in the command "xinput_calibrator" yields the message,
"Command 'xinput_calibrator' not found, but can be installed with: sudo apt install xinput-calibrator".
I'm not sure what went wrong.
Here is the output for each build command:
(./autogen.sh)
autoreconf: Entering directory .' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal autoreconf: configure.ac: tracing autoreconf: running: libtoolize --copy libtoolize: putting auxiliary files in '.'. libtoolize: copying file './ltmain.sh' libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac, libtoolize: and rerunning libtoolize and aclocal. libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am. autoreconf: running: /usr/bin/autoconf autoreconf: configure.ac: not using Autoheader autoreconf: running: automake --add-missing --copy --no-force configure.ac:32: installing './compile' autoreconf: Leaving directory
.'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/home/carbon/Downloads/xinput_calibrator-0.7.5/missing: Unknown --is-lightweight' option Try
/home/carbon/Downloads/xinput_calibrator-0.7.5/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
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 whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
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... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/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 how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
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 dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @file support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
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 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 -m elf_x86_64) 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 how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) 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 -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) 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... yes
checking that generated files are newer than configure... done
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
(make)
Making all in src
make[1]: Entering directory '/home/carbon/Downloads/xinput_calibrator-0.7.5/src'
Making all in calibrator
make[2]: Entering directory '/home/carbon/Downloads/xinput_calibrator-0.7.5/src/calibrator'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/carbon/Downloads/xinput_calibrator-0.7.5/src/calibrator'
Making all in gui
make[2]: Entering directory '/home/carbon/Downloads/xinput_calibrator-0.7.5/src/gui'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/carbon/Downloads/xinput_calibrator-0.7.5/src/gui'
make[2]: Entering directory '/home/carbon/Downloads/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 -DHAVE_X11_XRANDR=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,
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]
77 | 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]
92 | 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 behavior [-Wdelete-non-virtual-dtor]
37 | delete calibrator;
| ^~~~~~~~~~
In file included from main_common.hpp:108,
from main_x11.cpp:23:
calibrator/calibratorUsbtouchscreen.cpp: In member function ‘virtual bool CalibratorUsbtouchscreen::finish_data(XYinfo, int)’:
calibrator/calibratorUsbtouchscreen.cpp:216:25: warning: ‘ ’ directive writing 1 byte into a region of size 0 [-Wformat-overflow=]
216 | sprintf(new_opt, "%s %s=%d %s=%d %s=%d %s=%d %s=%d %s=%d %s=%c %s=%c %s=%c %s=%c\n",
| ^
In file included from /usr/include/stdio.h:867,
from main_common.hpp:24,
from main_x11.cpp:23:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:34: note: ‘__builtin___sprintf_chk’ output 54 or more bytes into a destination of size 22
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from main_common.hpp:105,
from main_x11.cpp:23:
calibrator.cpp: In member function ‘bool Calibrator::is_sysfs_name(const char*)’:
calibrator.cpp:192:42: warning: ‘%s’ directive writing up to 255 bytes into a region of size 23 [-Wformat-overflow=]
192 | (void) sprintf(filename, "%s/%s/%s", SYSFS_INPUT, ep->d_name, SYSFS_DEVNAME);
| ^~
In file included from /usr/include/stdio.h:867,
from main_common.hpp:24,
from main_x11.cpp:23:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:34: note: ‘__builtin___sprintf_chk’ output between 30 and 285 bytes into a destination of size 40
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 -lXrandr -lX11
libtool: link: g++ -Wall -ansi -pedantic -Wmissing-declarations -g -O2 -o xinput_calibrator xinput_calibrator-main_x11.o -lXext -lXi -lXrandr -lX11
make[2]: Leaving directory '/home/carbon/Downloads/xinput_calibrator-0.7.5/src'
make[1]: Leaving directory '/home/carbon/Downloads/xinput_calibrator-0.7.5/src'
Making all in man
make[1]: Entering directory '/home/carbon/Downloads/xinput_calibrator-0.7.5/man'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/carbon/Downloads/xinput_calibrator-0.7.5/man'
Making all in scripts
make[1]: Entering directory '/home/carbon/Downloads/xinput_calibrator-0.7.5/scripts'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/carbon/Downloads/xinput_calibrator-0.7.5/scripts'
make[1]: Entering directory '/home/carbon/Downloads/xinput_calibrator-0.7.5'
make[1]: Nothing to be done for 'all-am'.
make[1]: Leaving directory '/home/carbon/Downloads/xinput_calibrator-0.7.5'
Any help would be very much appreciated.
output when trying to compile:
vita@vita-ThinkPad-X200T:/Escritorio/xinput_calibrator-master$ sh autogen.sh/Escritorio/xinput_calibrator-master$ autogen.sh
autogen.sh: 9: autogen.sh: autoreconf: not found
vita@vita-ThinkPad-X200T:
bash: autogen.sh: no se encontró la orden
vita@vita-ThinkPad-X200T:/Escritorio/xinput_calibrator-master$ ./autogen.sh --with-gui=x11 make/Escritorio/xinput_calibrator-master$ ./autogen.sh --with-gui=x11
./autogen.sh: 9: ./autogen.sh: autoreconf: not found
vita@vita-ThinkPad-X200T:
./autogen.sh: 9: ./autogen.sh: autoreconf: not found
vita@vita-ThinkPad-X200T:/Escritorio/xinput_calibrator-master$ sh ./autogen.sh/Escritorio/xinput_calibrator-master$ ./autogen.sh
./autogen.sh: 9: ./autogen.sh: autoreconf: not found
vita@vita-ThinkPad-X200T:
./autogen.sh: 9: ./autogen.sh: autoreconf: not found
vita@vita-ThinkPad-X200T:/Escritorio/xinput_calibrator-master$ ./autogen/Escritorio/xinput_calibrator-master$
bash: ./autogen: No existe el archivo o el directorio
vita@vita-ThinkPad-X200T:
I've tested xinput_calibrator-0.7.5 with touchscreen driven by evdev, but it did not work because of several (design) problems of xinput_calibrator.
Since I wanted to get xinput_calibrator running in order to use the feature to calibrate without restart of xserver, I had to make following changes/hacks (done only in x11 gui version):
Please note, I am not experienced with xlib programming and I did not want to redesign the architecture of xinput_calibrator, so my changes are quite dirty, but they work for me. So I am posting the patch here for you so you may think about it and possibly fix or redesign the xinput_calibrator which I find as great application that was missing for a long time.
First few more information on what sw components were used:
-bash-4.1# evtest /dev/input/event4 Input driver version is 1.0.0 Input device ID: bus 0x13 vendor 0x80 product 0x0 version 0x1 Input device name: "eGalax EETI Serial TouchScreen" Supported events: Event type 0 (Sync) Event type 1 (Key) Event code 330 (Touch) Event type 3 (Absolute) Event code 0 (X) Value 0 Min 0 Max 2047 Event code 1 (Y) Value 0 Min 0 Max 2047 Event code 24 (Pressure) Value 0 Min 0 Max 127 Testing ... (interrupt to exit)
-bash-4.1# xinput list --long EETI EETI id=8 [slave pointer (2)] Reporting 4 classes: Class originated from: 8 Buttons supported: 5 Button labels: Button Unknown Button Unknown Button Unknown Button Wheel Up Button Wheel Down Button state: Class originated from: 8 Detail for Valuator 0: Label: Abs X Range: 0.000000 - 2047.000000 Resolution: 10000 units/m Mode: absolute Current value: 400.000000 Class originated from: 8 Detail for Valuator 1: Label: Abs Y Range: 0.000000 - 2047.000000 Resolution: 10000 units/m Mode: absolute Current value: 240.000000 Class originated from: 8 Detail for Valuator 2: Label: Abs Pressure Range: 0.000000 - 127.000000 Resolution: 10000 units/m Mode: absolute Current value: 0.000000
-bash-4.1# xdpyinfo | grep dimensions dimensions: 800x480 pixels (212x127 millimeters)
And the dirty patch itself:
diff -urNp xinput_calibrator-0.7.5-orig/src/calibrator/calibratorEvdev.cpp xinput_calibrator-0.7.5/src/calibrator/calibratorEvdev.cpp
--- xinput_calibrator-0.7.5-orig/src/calibrator/calibratorEvdev.cpp 2010-09-12 21:46:10.000000000 +0200
+++ xinput_calibrator-0.7.5/src/calibrator/calibratorEvdev.cpp 2010-12-21 09:33:06.000000000 +0100
@@ -34,6 +34,8 @@
#define EXIT_FAILURE 0
#endif
+#define INVALID_EVENT_TYPE -1
+
/***************************************
* Class for dynamic evdev calibration
* uses xinput "Evdev Axis Calibration"
@@ -46,12 +48,18 @@ private:
XDevice *dev;
int old_swap_xy;
+ int button_press_type;
+ int button_release_type;
+ int motion_type;
+ int motion_a, motion_b;
public:
CalibratorEvdev(const char* const device_name, const XYinfo& axys, const bool verbose,
XID device_id=(XID)-1, const int thr_misclick=0, const int thr_doubleclick=0,
const OutputType output_type=OUTYPE_AUTO);
~CalibratorEvdev();
+ virtual int register_events();
+ virtual int check_press_event(int *x, int *y);
virtual bool finish_data(const XYinfo new_axys, int swap_xy);
bool set_swapxy(const int swap_xy);
@@ -67,9 +75,16 @@ protected:
bool output_xinput(const XYinfo new_axys, int swap_xy, int new_swap_xy);
};
+
CalibratorEvdev::CalibratorEvdev(const char* const device_name0, const XYinfo& axys0, const bool verbose0, XID device_id, const int thr_misclick, const int thr_doubleclick, const OutputType output_type)
: Calibrator(device_name0, axys0, verbose0, thr_misclick, thr_doubleclick, output_type), old_swap_xy(0)
{
+ XYinfo curr_calib;
+ button_press_type = INVALID_EVENT_TYPE;
+ button_release_type = INVALID_EVENT_TYPE;
+ motion_type = INVALID_EVENT_TYPE;
+ motion_a = motion_b = 0;
+
// init
display = XOpenDisplay(NULL);
if (display == NULL) {
@@ -139,19 +154,37 @@ CalibratorEvdev::CalibratorEvdev(const c
} else if (nitems > 0) {
ptr = data;
- old_axys.x_min = *((long*)ptr);
+ curr_calib.x_min = *((long*)ptr);
ptr += sizeof(long);
- old_axys.x_max = *((long*)ptr);
+ curr_calib.x_max = *((long*)ptr);
ptr += sizeof(long);
- old_axys.y_min = *((long*)ptr);
+ curr_calib.y_min = *((long*)ptr);
ptr += sizeof(long);
- old_axys.y_max = *((long*)ptr);
+ curr_calib.y_max = *((long*)ptr);
ptr += sizeof(long);
}
XFree(data);
}
+ {
+ if (verbose)
+ printf("DEBUG: setting Evdev Axis Calibration to axis valuators.\n");
+
+ // No axis calibration set, set it to the default one
+ // QUIRK: when my machine resumes from a sleep,
+ // the calibration property is no longer exported thourgh xinput, but still active
+ // not setting the values here would result in a wrong first calibration
+ bool ok = set_calibration(old_axys);
+
+ if (verbose) {
+ if (ok)
+ printf("DEBUG: Successfully applied axis calibration.\n");
+ else
+ printf("DEBUG: Failed to apply axis calibration.\n");
+ }
+ }
+
// get "Evdev Axes Swap" property
property = xinput_parse_atom(display, "Evdev Axes Swap");
if (XGetDeviceProperty(display, dev, property, 0, 1000, False,
@@ -169,8 +202,8 @@ CalibratorEvdev::CalibratorEvdev(const c
// see http://cgit.freedesktop.org/xorg/driver/xf86-input-evdev/commit/?h=evdev-2.3-branch&id=3772676fd65065b43a94234127537ab5030b09f8
printf("Calibrating EVDEV driver for \"%s\" id=%i\n", device_name, (int)device_id);
- printf("\tcurrent calibration values (from XInput): min_x=%d, max_x=%d and min_y=%d, max_y=%d\n",
- old_axys.x_min, old_axys.x_max, old_axys.y_min, old_axys.y_max);
+ printf("\tprevious calibration values (from XInput): min_x=%d, max_x=%d and min_y=%d, max_y=%d\n",
+ curr_calib.x_min, curr_calib.x_max, curr_calib.y_min, curr_calib.y_max);
#endif // HAVE_XI_PROP
}
@@ -180,6 +213,72 @@ CalibratorEvdev::~CalibratorEvdev () {
XCloseDisplay(display);
}
+
+
+int CalibratorEvdev::register_events()
+{
+ int number = 0;
+ XEventClass event_list[7];
+ int i;
+ Window root_win;
+ unsigned long screen;
+ XInputClassInfo *ip;
+
+ screen = DefaultScreen(display);
+ root_win = RootWindow(display, screen);
+
+ if (dev->num_classes > 0) {
+ printf("register_events: num_classes=%d\n", dev->num_classes);
+ for (ip = dev->classes, i=0; i<dev->num_classes; ip++, i++) {
+ printf("register_events: input_class=%d\n", ip->input_class);
+ switch (ip->input_class) {
+ case ButtonClass:
+ DeviceButtonPress(dev, button_press_type, event_list[number]); number++;
+ DeviceButtonRelease(dev, button_release_type, event_list[number]); number++;
+ break;
+ case ValuatorClass:
+ DeviceMotionNotify(dev, motion_type, event_list[number]); number++;
+ break;
+ default:
+ fprintf(stderr, "unknown class\n");
+ break;
+ }
+ }
+
+ if (XSelectExtensionEvent(display, root_win, event_list, number)) {
+ fprintf(stderr, "error selecting extended events\n");
+ return 0;
+ }
+ printf("register_events: registered %d events with xinput\n", number);
+ }
+ return 1;
+}
+
+int CalibratorEvdev::check_press_event(int *x, int *y)
+{
+ XEvent event;
+
+ if (XCheckTypedEvent(display, motion_type, &event)) {
+ XDeviceMotionEvent *motion = (XDeviceMotionEvent *)&event;
+
+// printf("motion a=%d b=%d\n",
+// motion->axis_data[0], motion->axis_data[1]);
+ motion_a = motion->axis_data[0];
+ motion_b = motion->axis_data[1];
+ }
+ if (XCheckTypedEvent(display, button_release_type, &event)) {
+ XDeviceButtonEvent *button = (XDeviceButtonEvent *)&event;
+
+ printf("button release %d [%d,%d]\n", button->button, motion_a, motion_b);
+ *x = motion_a;
+ *y = motion_b;
+ return 1;
+ }
+ *x = -1;
+ *y = -1;
+ return 0;
+}
+
bool CalibratorEvdev::finish_data(const XYinfo new_axys, int swap_xy)
{
bool success = true;
diff -urNp xinput_calibrator-0.7.5-orig/src/calibrator.cpp xinput_calibrator-0.7.5/src/calibrator.cpp
--- xinput_calibrator-0.7.5-orig/src/calibrator.cpp 2010-09-12 21:46:10.000000000 +0200
+++ xinput_calibrator-0.7.5/src/calibrator.cpp 2010-12-20 12:42:26.000000000 +0100
@@ -124,12 +124,18 @@ inline bool Calibrator::along_axis(int x
(abs(xy - y0) <= threshold_misclick));
}
-bool Calibrator::finish(int width, int height)
+bool Calibrator::finish()
{
+ int width;
+ int height;
+
if (get_numclicks() != 4) {
return false;
}
+ width = abs(old_axys.x_max - old_axys.x_min) + 1;
+ height = abs(old_axys.y_max - old_axys.y_min) + 1;
+
// Should x and y be swapped?
const bool swap_xy = (abs (clicked_x [UL] - clicked_x [UR]) < abs (clicked_y [UL] - clicked_y [UR]));
if (swap_xy) {
diff -urNp xinput_calibrator-0.7.5-orig/src/calibrator.hh xinput_calibrator-0.7.5/src/calibrator.hh
--- xinput_calibrator-0.7.5-orig/src/calibrator.hh 2010-09-12 21:46:10.000000000 +0200
+++ xinput_calibrator-0.7.5/src/calibrator.hh 2010-12-20 12:42:26.000000000 +0100
@@ -50,11 +50,16 @@ public:
// add a click with the given coordinates
bool add_click(int x, int y);
// calculate and apply the calibration
- bool finish(int width, int height);
+ bool finish();
// get the sysfs name of the device,
// returns NULL if it can not be found
const char* get_sysfs_name();
+ // optionally overload this to listen for events ourselves
+ virtual int register_events() { return 0; }
+ // optionally overload this to process events directly
+ virtual int check_press_event(int *x, int *y) { return 0; }
+
protected:
// check whether the coordinates are along the respective axis
bool along_axis(int xy, int x0, int y0);
diff -urNp xinput_calibrator-0.7.5-orig/src/gui/gui_x11.cpp xinput_calibrator-0.7.5/src/gui/gui_x11.cpp
--- xinput_calibrator-0.7.5-orig/src/gui/gui_x11.cpp 2010-09-12 21:46:10.000000000 +0200
+++ xinput_calibrator-0.7.5/src/gui/gui_x11.cpp 2010-12-21 09:33:48.000000000 +0100
@@ -92,12 +92,13 @@ protected:
XFontStruct* font_info;
// color mngmt
unsigned long pixel[nr_colors];
+ bool calib_input;
// Signal handlers
bool on_timer_signal();
bool on_expose_event();
- bool on_button_press_event(XEvent event);
+ bool on_button_press_event(int x, int y);
// Helper functions
void set_display_size(int width, int height);
@@ -159,8 +160,11 @@ GuiCalibratorX11::GuiCalibratorX11(Calib
// Listen to events
XGrabKeyboard(display, win, False, GrabModeAsync, GrabModeAsync,
CurrentTime);
- XGrabPointer(display, win, False, ButtonPressMask, GrabModeAsync,
+ calib_input = calibrator->register_events();
+ if (!calib_input) {
+ XGrabPointer(display, win, False, ButtonPressMask, GrabModeAsync,
GrabModeAsync, None, None, CurrentTime);
+ }
Colormap colormap = DefaultColormap(display, screen_num);
XColor color;
@@ -294,7 +298,7 @@ bool GuiCalibratorX11::on_timer_signal()
return true;
}
-bool GuiCalibratorX11::on_button_press_event(XEvent event)
+bool GuiCalibratorX11::on_button_press_event(int x, int y)
{
// Clear window, maybe a bit overdone, but easiest for me atm.
// (goal is to clear possible message and other clicks)
@@ -302,7 +306,7 @@ bool GuiCalibratorX11::on_button_press_e
// Handle click
time_elapsed = 0;
- bool success = calibrator->add_click(event.xbutton.x, event.xbutton.y);
+ bool success = calibrator->add_click(x, y);
if (!success && calibrator->get_numclicks() == 0) {
draw_message("Mis-click detected, restarting...");
@@ -311,7 +315,7 @@ bool GuiCalibratorX11::on_button_press_e
// Are we done yet?
if (calibrator->get_numclicks() >= 4) {
// Recalibrate
- success = calibrator->finish(display_width, display_height);
+ success = calibrator->finish();
if (success) {
exit(0);
@@ -352,6 +356,10 @@ void GuiCalibratorX11::give_timer_signal
// process events
XEvent event;
+ int x, y;
+ if (instance->calib_input)
+ if (instance->calibrator->check_press_event(&x, &y))
+ instance->on_button_press_event(x, y);
while (XCheckWindowEvent(instance->display, instance->win, -1, &event) == True) {
switch (event.type) {
case Expose:
@@ -360,11 +368,10 @@ void GuiCalibratorX11::give_timer_signal
break;
instance->on_expose_event();
break;
-
case ButtonPress:
- instance->on_button_press_event(event);
+ if (!instance->calib_input)
+ instance->on_button_press_event(event.xbutton.x, event.xbutton.y);
break;
-
case KeyPress:
exit(0);
break;
Finally a debug output of successful calibration:
-bash-4.1# ./xinput_calibrator --output-type xinput -v DEBUG: XInputExtension version is 2.0 DEBUG: Skipping virtual master devices and devices without axis valuators. DEBUG: Skipping device 'Virtual core XTEST pointer' id=4, does not report Absolute events. DEBUG: Skipping device 'Mouse0' id=6, does not report Absolute events. DEBUG: Selected device: EETI DEBUG: Not usbtouchscreen calibrator: Not a usbtouchscreen device DEBUG: setting Evdev Axis Calibration to axis valuators. DEBUG: Successfully applied axis calibration. DEBUG: Read axes swap value of 0. Calibrating EVDEV driver for "EETI" id=8 previous calibration values (from XInput): min_x=0, max_x=2047 and min_y=0, max_y=2047 register_events: num_classes=4 register_events: input_class=1 register_events: input_class=2 register_events: input_class=3 unknown class register_events: input_class=6 unknown class register_events: registered 3 events with xinput button release 1 [381,1691] DEBUG: Adding click 0 (X=381, Y=1691) button release 1 [1699,1676] DEBUG: Adding click 1 (X=1699, Y=1676) button release 1 [380,363] DEBUG: Adding click 2 (X=380, Y=363) button release 1 [1711,369] DEBUG: Adding click 3 (X=1711, Y=369) Doing dynamic recalibration: Setting new calibration data: 160, 1924, 1901, 146 DEBUG: Successfully applied axis calibration. --> Making the calibration permanent Install the 'xinput' tool and copy the command(s) below in a script that starts with your X session xinput set-int-prop "EETI" "Evdev Axis Calibration" 32 160 1924 1901 146
Hope that helps...
And maybe a final note - I am not completely sure about the Calibrator::finish() formulas - there are used 'width' and 'height' parameters on one side but on the other side inside the scaling computation, difference between 'max' and 'min' coordinates is used. If the source and target resolutions were the same, there would be off by one difference between (max - min) and width/height. Probably would not influence much and I do not see too deep into the calculation so it may be ok, but I was just wondering...
In the distribution packages, the "Calibrate Touchscreen" menu item should persist the calibration in a way which is appropriate to the distribution.
Perhaps ask the user "Apply calibration system wide or just for this user?"
also match XI_TABLET for calibration
diff --git a/src/main_common.hpp b/src/main_common.hpp index a822034..b94aa9d 100644 --- a/src/main_common.hpp +++ b/src/main_common.hpp @@ -153,12 +153,13 @@ int find_device(const char* pre_device, bool verbose, bool Atom atomTouchscreen = XInternAtom(display, XI_TOUCHSCREEN, False); + Atom atomTablet = XInternAtom(display, XI_TABLET, False); int ndevices; XDeviceInfoPtr list, slist; slist=list=(XDeviceInfoPtr) XListInputDevices (display, &ndevices); for (int i=0; itype != atomTouchscreen) + if (list->type != atomTouchscreen && list->type != atomTablet) continue; // if we are looking for a specific device
I have a 21.5" LED Touch Monitor with usb touchpanel
ID 0eef:0001 D-WAV Scientific Co., Ltd eGalax TouchScreen
I tried to install and configure it in Ubuntu Linux 14.04.2,. I installed the xinput-calibrator package (Version: 0.7.5+git20140201-1) but I have no good results.
Debugging the panel output with evtest I see that the output panel is not as linear as it shoud!
Do you know if does evdev driver support linearization or where to ask for it?
Thanks,
Source code is
sprintf(new_opt, "%s %s=%d %s=%d %s=%d %s=%d %s=%d %s=%d %s=%c %s=%c %s=%c %s=%c\n",
opt, p_range_x, range_x, p_range_y, range_y,
p_min_x, new_axys.x_min, p_min_y, new_axys.y_min,
p_max_x, new_axys.x_max, p_max_y, new_axys.y_max,
p_transform_xy, yesno(true), p_flip_x, yesno(flip_x),
p_flip_y, yesno(flip_y), p_swap_xy, yesno(swap_xy));
and new_opt is about 22 bytes long. Suggest increase size of new_opt.
since v0.3.2 or smth, evdev supports the 'calibration' option in both x.org and hal/udev. write this on stdout after calibrating evdev
My device has 2 touchscreen attached. xinput-calibrator selects second one and does not allow to calibrate first one without restarting X11 with other config.
instead of averaging the click-coordinates and then computing the min/max values, we could compute the min/max values using the clicks separately, and average the min/max values itself.
instead of min = calib( (x1 + x2)/2 )
do min = ( calib(x1) + calib(x2) )/2
I seem to have closed issue #22 myself. This ight be because I reposted the snippet from /var/log/Xorg.0.log.
I have now deleted my comment and edited the issue instead.
How do I reopen it? Or could someone else do it. Please help.
;)Frode
I am Using Debian Squeeze Gnome, on a Lenovo with ELO Touch. For some reason the calibrator will only input the first cross hair, when the second one comes up I tap it, it restarts the timer, but continues to stay red, so I never get to see the 3rd one or complete calibration.
I am using xinput_calibrator-0.7.5
Your Makefile has C++ compiler hardcoded to "g++" which makes cross compiling harder. Switching g++ to $(CXX) solves problem.
Adding
Hi,
Complete linux novice, running puppy 5.7 on Asus Eeepc 900HA with egalax touchscreen.
Modified xorg.conf to have the touchscreen point to the evtouch driver. Touch works but with inverted axis.
Then I ran the calibrator after installing and nothing happens.
Any help would be appreciated.
As reported by Sam Lin:
BTW some bad calibration result may make further calibration impossible.
So that would be a nice option to reset calibration to default instead
of last calibration value before further calibration.
Some bad calibration value may trigger screen edge behavior of compiz so
if take it in consideration will be nice too."
Hi!
I'm trying to calibrate device "HID 24b8:0001" (that's all I can tell - It's a glass touch panel that I mount over the 17" LCD monitor).
On my old system (Ubuntu 12.04 - xinput_calibrator 0.7.5-0ubuntu1) calibration works fine, but on my new system (Ubuntu 16.04 - xinput_calibrator 0.7.5+git20140201-1) I have strange problems. On some touch screens it works fine on others it don't. Sometimes I have to first write config with Option "Calibration" "262 1281 1167 374"
and then run xinput_calibrator
, sometimes even this won't help.
So I searched for problems on Google and found this old thread (answer #2) and make it work on one touch panel that couldn't make it work with xinput_calibrator
.
I was all happy moving to my next panel. And here this procedure don't work. I get all data touching panel with evtest
and search for x_min, x_max, y_min, y_max, write this to my config Option "Calibration" "264 1235 384 1133"
- panel not working. THEN I run xinput_calibrator
and panel starts working normally. But after xinput_calibrator
those coordinate figures are "235 1258 1149 345"
. Very similar to what I got from evtest
except y_min and y_max are opposite (first number is higher then second). What those calibration coordinates really represent?
I just can't figure out what is wrong and what to do to make all panels work with same procedure. Most annoying is, that on Ubuntu 12.04 xinput_calibrator
worked for all my touch panels with no "hacks".
I really hope someone here could help me.
Thank you!
When I start up xinput_calibrator I get two rather strange messages that look something like this:
./xinput_calibrator: eval: line 1: can't cd to /home/jdoe/xinput_calibrator/xinput_calibrator-0.7.5/src
./xinput_calibrator: eval: line 2: arm-none-linux-gnueabi-g++: not found
This system is an embedded version of linux "poky". xinput_calibrator is not being run in the same location where it was built. The arm-none-linux-gnueabi-g++ is the arm c++ compiler. Why is it being called. There is not a compiler on this system. How do I fix this ?
Randy Seedle
Applied Rigaku
root@bug:~# xinput_calibrator
Warning: multiple calibratable devices found, calibrating last one (ts5)
X Error of failed request: BadRequest (invalid request code or no such operation)
Major opcode of failed request: 144 (XInputExtension)
Minor opcode of failed request: 36 ()
Serial number of failed request: 12
Current serial number in output stream: 12
I use xserver 1.5.3, evdev 2.1.0
I have two monitors. The first monitor is the primary screen which doesn't have touch functionality. The secondary screen is cintiq 22hd. When I try to calibrate cintiq 22hd with xinput_calibrator, xinput_calibrator pops up on the primary screen.
How can I fix this?
OS : Arch Linux
Desktop Environment : XFCE 4.12
I have a Panasonic CF-T2 which I've handled with evtouch before. Trying out xinput_calibrator, I find that it doesn't detect it. I'm running a pristine Karmic. I've attached some info, let me know if I can attach something else. Thanks -- eric
eric@epiphany:~/Downloads/xinput_calibrator$ sudo src/xinput_calibrator_x11 --list
No calibratable devices found.
eric@epiphany:~/Downloads/xinput_calibrator$ udevadm info --name=/dev/input/by-id/usb-Fujitsu_Takamisawa_USB_Touch_Panel-mouse --query=all
P: /devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0/input/input6/mouse1
N: input/mouse1
S: char/13:33
S: input/by-id/usb-Fujitsu_Takamisawa_USB_Touch_Panel-mouse
S: input/by-path/pci-0000:00:1d.2-usb-0:1:1.0-mouse
E: UDEV_LOG=3
E: DEVPATH=/devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0/input/input6/mouse1
E: MAJOR=13
E: MINOR=33
E: DEVNAME=/dev/input/mouse1
E: SUBSYSTEM=input
E: ID_VENDOR=Fujitsu_Takamisawa
E: ID_VENDOR_ENC=Fujitsu\x20Takamisawa
E: ID_VENDOR_ID=0430
E: ID_MODEL=USB_Touch_Panel
E: ID_MODEL_ENC=USB\x20Touch\x20Panel
E: ID_MODEL_ID=0501
E: ID_REVISION=1130
E: ID_SERIAL=Fujitsu_Takamisawa_USB_Touch_Panel
E: ID_TYPE=hid
E: ID_BUS=usb
E: ID_USB_INTERFACES=:030102:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=usbhid
E: ID_CLASS=mouse
E: ID_PATH=pci-0000:00:1d.2-usb-0:1:1.0
E: DEVLINKS=/dev/char/13:33 /dev/input/by-id/usb-Fujitsu_Takamisawa_USB_Touch_Panel-mouse /dev/input/by-path/pci-0000:00:1d.2-usb-0:1:1.0-mouse
eric@epiphany:~/Downloads/xinput_calibrator$ udevadm info --name=/dev/input/by-id/usb-Fujitsu_Takamisawa_USB_Touch_Panel-event-mouse --query=all
P: /devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0/input/input6/event6
N: input/event6
S: char/13:70
S: input/by-id/usb-Fujitsu_Takamisawa_USB_Touch_Panel-event-mouse
S: input/by-path/pci-0000:00:1d.2-usb-0:1:1.0-event-mouse
E: UDEV_LOG=3
E: DEVPATH=/devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0/input/input6/event6
E: MAJOR=13
E: MINOR=70
E: DEVNAME=/dev/input/event6
E: SUBSYSTEM=input
E: ID_VENDOR=Fujitsu_Takamisawa
E: ID_VENDOR_ENC=Fujitsu\x20Takamisawa
E: ID_VENDOR_ID=0430
E: ID_MODEL=USB_Touch_Panel
E: ID_MODEL_ENC=USB\x20Touch\x20Panel
E: ID_MODEL_ID=0501
E: ID_REVISION=1130
E: ID_SERIAL=Fujitsu_Takamisawa_USB_Touch_Panel
E: ID_TYPE=hid
E: ID_BUS=usb
E: ID_USB_INTERFACES=:030102:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=usbhid
E: ID_CLASS=mouse
E: ID_PATH=pci-0000:00:1d.2-usb-0:1:1.0
E: DMI_VENDOR=Matsushita Electric Industrial Co.,Ltd.
E: DEVLINKS=/dev/char/13:70 /dev/input/by-id/usb-Fujitsu_Takamisawa_USB_Touch_Panel-event-mouse /dev/input/by-path/pci-0000:00:1d.2-usb-0:1:1.0-event-mouse
this output is not supported anymore
"XorgPrint Calibrator does not support the supplied --output-type"
this file:
xinput_calibrator/scripts/xinput_calibrator_pointercal.sh
and help
--output-type <auto|xorg.conf.d|hal|xinput>: type of config to ouput (auto=automatically detect, default: auto) need to be fixed
Setup:
Touchscreen (IIyama T1931SR-B1 or Elo)
Non-Touch (Dell or HP 19" Desktop Monitor)
Nvidia Videocard - Nouveau Drivers - Extended Desktop (Xinerama)
When running xinput_calibrator the calibration window with the targets gets stretched across both screens. This is silly as there is no situation ever where this would be useful. Please fix xinput_calibrator to only show the targets for and calibration for one screen at a time. Especially only on the touchscreen itself.
If you need any logs or config files or to test let me know I have 10 of these configurations.
Thanks a million
Before installing xinput_calibrator (build from source on Porteus linux) I had a custom xmodmap rule file in a couple of user directories. It would work every boot no matter the user. There was persistence on boots where xmodmap would run each boot and include my custom rules file.
Ever since running xinput_calibrator to calibrate the touchscreen on my webdt tablet xmodmap will no longer run on boot. I have scripted xmodmap to start in a 777 file and I can try to call this file in rc.local with a sleep value or via rc4.d in an autostart file.
I have tried to call my startxmodmap file from an exec /usr/bin/xmodmap /home/guest/.Xmodmap in the autostart area in LXDE and it still wont fly. Out of potential start points for this script Each boot I need to connect a usb keyboard to the tablet and issue the command manually if I wish to have mapped keycodes (essential for this tablet as it has a dpad and hard buttons on the front of the tablet.
What can I provide (no experience troubleshooting input events) in order to determine how xmodmap was broken? This was built up from a fresh install and to make sure I started over and produced the same results. xmodmap worked up to calibrating the T/S. Its like something is turning it off no matter how hard I try to get it started.
Thank you in advance
Daryl
I am running xinput_calibrator in an environment without window manager (embedded linux box with touch screen to control a machine). Only part of the calibration window is displayed showing a single cross. Hence, calibration is not operational (eventually crashing or throwing division by 0).
This might be close to other open issue suggesting to add --geometry argument. Has this been merged to xinput_calibrator ?
Antoine
When is the next release? Is the "master" branch fairly stable?
Axis Swap and Inversion are deprecated by Canonical's multi-pointer patches, and those X versions only support the Coordinate Transformation Matrix. Is this supported by xinput_calibrator? We're seeing some calibration "drift" with transformed input devices.
E.g.: We (mis-)calibrate the screen repeatedly by clicking 5mm below the crosshair. With non-rotated devices, the calibration keeps constant (± finger size) – after the initial calibration, taps on the crosshair are registered on them. As it should.
If we rotate the device, the calibration starts to drift off – with each iteration, the pointer is more and more off, rapidly going off screen.
Some example calibration results:
Intial Calibration: 0,4096,0,496
Is there a way to fix/circumvent this (apart from manually resetting the calibration)?
when using the XRANDR support for detecting screensize the default screensize is used instead of the actual screensize.
Function XRRSizes is used and first returned result is taken as the screen size (in GUI_X11:135, manpage for XRANDR(3) states that the first item in the list is the default size.
Iam not knowledgable in Xrandr enough to see from a look at the manpage how to get the current config.
Calibration fails when initial calibration values are set to unusual and improper values:
[1]
xinput set-int-prop "Elo TouchSystems, Inc. Elo TouchSystems 2700 IntelliTouch(r) USB Touchmonitor Interface" "Evdev Axis Calibration" 32 0 1000 0 1000
[2]
xinput set-int-prop "Elo TouchSystems, Inc. Elo TouchSystems 2700 IntelliTouch(r) USB Touchmonitor Interface" "Evdev Axis Calibration" 32 0 0 0 0
[3]
xinput set-int-prop "Elo TouchSystems, Inc. Elo TouchSystems 2700 IntelliTouch(r) USB Touchmonitor Interface" "Evdev Axis Calibration" 32 825 3246 1151 2124
xinput_calibrator doesn't work in these cases.
[1] The first target accept a touch, but the second target touch is rejected as a mis-click.
[2] The first target accept a touch, but the second target ignores all touch attempts and resets the timer.
[3] All targets accept touches, but the resulting calibration 422, 3648, 990, 2283 is not even close to being correct.
When properly calibrated the values are approximately 0, 4000, 0, 4000.
I've tested the current master (9b0803b) on our two Elo screens and normal/inverted rotation calibration works fine. The problem comes when we rotate the screen to the left or right. Then the returned calibration output looks like this: https://gist.github.com/3031786. Compared to the state before the changes from 21/6 onward, it's absolutely broken. Before our issue was that when rotated left/right the axis invertion would be wrong and a second run would fix it. Now it's unusable.
Currently Xorg.conf and (HAL) FDI policy file values are printed. Add a sample udev rule too (perhaps replace FDI ?)
Hello -
I'm not sure if this is even a bug, because it does --work--
But it only calibrates properly after I run it, feed xorg the config, restart, run it again, and then feed xorg the updated config again.
I'm running this on gentoo, Xorg 1.9, evdev setup, Lilliput 7" touchscreen (VGA).
Thanks!
-Marshall Buschman
Was looking at some code that parsed the X calibration info out of the output, and discovered that there's actually an --output-file
option in the code (and the --help
) but not in the man page. Might be an easy contributor project to update it...
vote down 1 vote
Calibrator will only take the first input
3 comments Created 6 days ago by rdonnelly2 | edit
I am Using Debian Squeeze Gnome, on a Lenovo with ELO Touch. For some reason the calibrator will only input the first cross hair, when the second one comes up I tap it, it restarts the timer, but continues to stay red, so I never get to see the 3rd one or complete calibration.
I am using xinput_calibrator-0.7.5
Comments
tonio73 1 day ago | link
Maybe you can turn on verbose (-v) and send us the command output.
rdonnelly2 22 minutes ago | link | edit | delete
src/xinput_calibrator -v
DEBUG: XInputExtension version is 2.0
DEBUG: Skipping virtual master devices and devices without axis valuators.
DEBUG: Skipping device 'Virtual core XTEST pointer' id=4, does not report Absolute events.
DEBUG: Skipping device 'HID 0a5c:4503' id=9, does not report Absolute events.
DEBUG: Skipping device 'Macintosh mouse button emulation' id=14, does not report Absolute events.
Warning: multiple calibratable devices found, calibrating last one (Elo TouchSystems Elo TouchSystems 2515 IntelliTouch Plus USB Touchmonitor)
use --device to select another one.
DEBUG: Selected device: Elo TouchSystems Elo TouchSystems 2515 IntelliTouch Plus USB Touchmonitor
DEBUG: Not usbtouchscreen calibrator: Not a usbtouchscreen device
DEBUG: Read axes swap value of 0.
Calibrating EVDEV driver for "Elo TouchSystems Elo TouchSystems 2515 IntelliTouch Plus USB Touchmonitor" id=13
current calibration values (from XInput): min_x=0, max_x=4095 and min_y=0, max_y=4095
DEBUG: Adding click 0 (X=1697, Y=782)
DEBUG: Not adding click 1 (X=1697, Y=782): within 7 pixels of previous click
DEBUG: Not adding click 1 (X=1697, Y=782): within 7 pixels of previous click
DEBUG: Not adding click 1 (X=1697, Y=782): within 7 pixels of previous click
rdonnelly2 5 minutes ago | link | edit | delete
I think my mouse may be interfering? I am able to hit the 4 cross hairs with the mouse and LMB. Here is the output.
Warning: multiple calibratable devices found, calibrating last one (Elo TouchSystems Elo TouchSystems 2515 IntelliTouch Plus USB Touchmonitor)
use --device to select another one.
Calibrating EVDEV driver for "Elo TouchSystems Elo TouchSystems 2515 IntelliTouch Plus USB Touchmonitor" id=13
current calibration values (from XInput): min_x=7, max_x=4092 and min_y=-4, max_y=4087
Doing dynamic recalibration:
Setting new calibration data: 18, 4084, -10, 4080
--> Making the calibration permanent <-- Install the 'xinput' tool and copy the command(s) below in a script that starts with your X session
xinput set-int-prop "Elo TouchSystems Elo TouchSystems 2515 IntelliTouch Plus USB Touchmonitor" "Evdev Axis Calibration" 32 18 4084 -10 4080
On my touchscreen, occasionaly a single click is totally misread, putting the pointer somewhere else. If this happens during calibration, wrong values are used.
Such a rogue click can be easily detected, if |y[UL] - y[UR]| > treshold it is a rogue click.
In that case, we could restart calibration.
Note that if the touchscreen has non-rectangular deformation, every click will be interpreted as a rogue click (which is correct, min/max x/y calibration can not correct such deformation)
[perhaps document this too ?]
I'm trying to calibrate the touchscreen of an HP Pavilion TX1000 with the stylus. When the calibration values are applied (via xinput set-prop), the touchscreen remains inaccurate, and notably, the proportions seem to be wrong.
I'd be happy to supply more details in order to help you iron this out.
Thanks!
The calibrator generated
xinput set-int-prop "IDEACOM IDC 6680" "Evdev Axis Calibration" 32 -203 65417 -39 65345
but that didn't seem to affect the calibration at all.
I was able to calibrate manually with the steps at
http://setupguides.blogspot.com/2010/10/calibrating-touchscreen-in-ubuntu-1010.html
which yielded this working command:
xinput set-int-prop 10 "Evdev Axis Calibration" 32 200 8000 450 7950
$ xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ IDEACOM IDC 6680 id=10 [slave pointer (2)]
⎜ ↳ IDEACOM IDC 6680 id=11 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=15 [slave pointer (2)]
⎜ ↳ Macintosh mouse button emulation id=17 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Video Bus id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Power Button id=8 [slave keyboard (3)]
↳ Sleep Button id=9 [slave keyboard (3)]
↳ HID 413c:8161 id=12 [slave keyboard (3)]
↳ Integrated_Webcam_1.3M id=13 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=14 [slave keyboard (3)]
↳ Dell WMI hotkeys id=16 [slave keyboard (3)]
$ uname -a
Linux rmattb-laptop 2.6.32-33-generic #72-Ubuntu SMP Fri Jul 29 21:08:37 UTC 2011 i686 GNU/Linux
Let me know if there's any other information I can provide which will help.
tslib is a specialized touchscreen library and Xorg driver, developed for embedded devices.
Investigate if we can also recalibrate it ? It does not use min/max x/y values, but a more complex system, so that might be very challenging.
Its great when I find this software in Ubuntu 12.04LTS repository with my ASUS R2H!
I wonder if I don't need to manually sudoedit after every calibrating...
I just did a clean checkout of xinput_calibrator and my screen is rotated with xrandr -o left and when it loads up it still thinks I'm in xrandr -o normal for some reason. This doesn't happen with the xinput_calibrator that you get when you apt-get install xinput_calibrator though
any packaging help on this front is appreciated : )
I have troubble using xinput_calibrator on Ubuntu Maverick on an Asus EeeTop ET202T A1.
The tool reports misclicks all the time, and when I use '--misclick 0' i am told to create a file containing some special characters in the MatchProduct string. This does not work.
If I try to use MatchDevicePath I am unsure what to use as match string. The pointer behaves erratically if I use the wron ones. Can you please help?
Please find details in the following:
xinput_calibrator --misclick 0
Warning: multiple calibratable devices found, calibrating last one (IDEACO� IDC 6681)
use --device to select another one.
Calibrating EVDEV driver for "IDEACO� IDC 6681" id=9
current calibration values (from XInput): min_x=0, max_x=65535 and min_y=0, max_y=65535
Doing dynamic recalibration:
Setting new calibration data: 1472, 66213, 6, 63744
--> Making the calibration permanent <--
copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf'
Section "InputClass"
Identifier "calibration"
MatchProduct "IDEACO� IDC 6681"
Option "Calibration" "1472 66213 6 63744"
EndSection
Note that the tool wanrns me that there are two devices available. Detals for the first device, although neither of them works:
$ xinput_calibrator --device 8 --misclick 0
Calibrating EVDEV driver for "IDEACO� IDC 6681" id=8
current calibration values (from XInput): min_x=0, max_x=8191 and min_y=0, max_y=8191
Doing dynamic recalibration:
Setting new calibration data: 713, 4754, -8, 8098
--> Making the calibration permanent <--
copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf'
Section "InputClass"
Identifier "calibration"
MatchProduct "IDEACO� IDC 6681"
Option "Calibration" "713 4754 -8 8098"
EndSection
Snippet fom /var/log/Xorg.0.log. note that there is no mention of calibration. If I use a simpler MatchProduct string, all the IDC devices are calibrated, and this does not work. Using MatchDevicePath could solve the problem, but which device do I use? And then I would need to set up a udev rule, I guess, to make the path consistent.
[ 3544.826] (II) XKB: reuse xkmfile /var/lib/xkb/server-B20D7FC79C7F597315E3E501AEF10E0D866E8E92.xkm
[ 3544.853] (II) config/udev: Adding input device Power Button (/dev/input/event1)
[ 3544.853] (**) Power Button: Applying InputClass "evdev keyboard catchall"
[ 3544.853] (II) LoadModule: "evdev"
[ 3544.854] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
[ 3544.855] (II) Module evdev: vendor="X.Org Foundation"
[ 3544.855] compiled for 1.9.0, module version = 2.3.2
[ 3544.855] Module class: X.Org XInput Driver
[ 3544.855] ABI class: X.Org XInput driver, version 11.0
[ 3544.855] (**) Power Button: always reports core events
[ 3544.855] (**) Power Button: Device: "/dev/input/event1"
[ 3544.873] (II) Power Button: Found keys
[ 3544.873] (II) Power Button: Configuring as keyboard
[ 3544.873] (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD)
[ 3544.873] (**) Option "xkb_rules" "evdev"
[ 3544.873] (**) Option "xkb_model" "evdev"
[ 3544.873] (**) Option "xkb_layout" "no"
[ 3544.880] (II) XKB: reuse xkmfile /var/lib/xkb/server-98DE986667AD67BA200A7AACB598729E85757727.xkm
[ 3544.886] (II) config/udev: Adding input device Power Button (/dev/input/event0)
[ 3544.886] (**) Power Button: Applying InputClass "evdev keyboard catchall"
[ 3544.886] (**) Power Button: always reports core events
[ 3544.886] (**) Power Button: Device: "/dev/input/event0"
[ 3544.905] (II) Power Button: Found keys
[ 3544.905] (II) Power Button: Configuring as keyboard
[ 3544.905] (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD)
[ 3544.905] (**) Option "xkb_rules" "evdev"
[ 3544.905] (**) Option "xkb_model" "evdev"
[ 3544.905] (**) Option "xkb_layout" "no"
[ 3544.911] (II) config/udev: Adding input device IDEACO� IDC 6681 (/dev/input/event2)
[ 3544.911] (**) IDEACO� IDC 6681: Applying InputClass "evdev tablet catchall"
[ 3544.911] (**) IDEACO� IDC 6681: always reports core events
[ 3544.911] (**) IDEACO� IDC 6681: Device: "/dev/input/event2"
[ 3544.937] (II) IDEACO� IDC 6681: Found 3 mouse buttons
[ 3544.937] (II) IDEACO� IDC 6681: Found absolute axes
[ 3544.937] (II) evdev-grail: failed to open grail, no gesture support
[ 3544.937] (II) IDEACO� IDC 6681: Found x and y absolute axes
[ 3544.937] (II) IDEACO� IDC 6681: Found absolute tablet.
[ 3544.937] (II) IDEACO� IDC 6681: Configuring as tablet
[ 3544.938] (**) IDEACO� IDC 6681: YAxisMapping: buttons 4 and 5
[ 3544.938] (**) IDEACO� IDC 6681: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[ 3544.938] (II) XINPUT: Adding extended input device "IDEACO� IDC 6681" (type: TABLET)
[ 3544.938] (II) IDEACO� IDC 6681: initialized for absolute axes.
[ 3544.939] (II) config/udev: Adding input device IDEACO� IDC 6681 (/dev/input/mouse0)
[ 3544.939] (II) No input driver/identifier specified (ignoring)
[ 3544.940] (II) config/udev: Adding input device IDEACO� IDC 6681 (/dev/input/event3)
[ 3544.940] (**) IDEACO� IDC 6681: Applying InputClass "evdev pointer catchall"
[ 3544.940] (**) IDEACO� IDC 6681: always reports core events
[ 3544.940] (**) IDEACO� IDC 6681: Device: "/dev/input/event3"
[ 3544.969] (II) IDEACO� IDC 6681: Found 3 mouse buttons
[ 3544.969] (II) IDEACO� IDC 6681: Found absolute axes
[ 3544.969] (II) evdev-grail: failed to open grail, no gesture support
[ 3544.969] (II) IDEACO� IDC 6681: Found x and y absolute axes
[ 3544.969] (II) IDEACO� IDC 6681: Configuring as mouse
[ 3544.969] (**) IDEACO� IDC 6681: YAxisMapping: buttons 4 and 5
[ 3544.969] (**) IDEACO� IDC 6681: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[ 3544.969] (II) XINPUT: Adding extended input device "IDEACO� IDC 6681" (type: MOUSE)
[ 3544.970] (II) IDEACO� IDC 6681: initialized for absolute axes.
[ 3544.971] (II) config/udev: Adding input device IDEACO� IDC 6681 (/dev/input/js0)
[ 3544.971] (II) No input driver/identifier specified (ignoring)
[ 3544.971] (II) config/udev: Adding input device IDEACO� IDC 6681 (/dev/input/mouse1)
[ 3544.971] (II) No input driver/identifier specified (ignoring)
[ 3544.973] (II) config/udev: Adding input device Chicony 2.4G Multimedia Wireless Kit (/dev/input/event4)
[ 3544.973] (**) Chicony 2.4G Multimedia Wireless Kit: Applying InputClass "evdev keyboard catchall"
[ 3544.973] (**) Chicony 2.4G Multimedia Wireless Kit: always reports core events
[ 3544.973] (**) Chicony 2.4G Multimedia Wireless Kit: Device: "/dev/input/event4"
[ 3545.001] (II) Chicony 2.4G Multimedia Wireless Kit: Found keys
Once swap_xy is on, the calibrator will not put it off again.
Eg if a users (without understanding why) configs swap_xy=1, then the calibrator will suggest swap_xy=1. This is because it wants to change the current swap_xy value, and it supposes that that value = 0.
It seems very unlikely that this should occur, but now that I realized it, might as well fix it someday.
I just realized that I had spent some time analyzing a problem that has been fixed four years ago.
With 0.7.5 being close to 4 1/2 years old and the last commit having been made a year ago, a 0.7.6 or 0.8.0 release should be made to prevent people from using the ancient 0.7.5 release. Personally I'd call it 0.7.6 and save 0.8 for when #46 is implemented.
Platform: Raspberry Pi Zero, Raspbian Jessie Lite, X11-core and LDXE-core.
Planar PT1701MU touchscreen with USB.
When I boot up, the cursor moves around when I touch the screen, but does not really work.
When I run xinput_calibrator, the program lets me touch the 4 calibration points OK, which leads me to believe 2 things: 1) The touch screen hardware works, and 2) It is possible to calibrate the touchscreen to work in my platform.
However, when I am done, the program closes OK and provides instructions for making the calibration permanent. The touchscreen no longer works after the xinput_calibrator is run until I reboot.
I would like to try to use the settings returned by xinput_calibrator, however, I cannot figure out where to copy the settings to in Raspbian Jessie Lite.
Any help will be greatly appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.