xinput_calibrator

Langue: en

Version: 366612 (MeeGo - 06/11/10)

Section: 1 (Commandes utilisateur)

NAME

xinput_calibrator - A generic touchscreen calibration program for X.Org

SYNOPSIS

xinput_calibrator [OPTIONS]

DESCRIPTION

xinput_calibrator is a program for calibrating your touchscreen, when using the X Window System.

It currently features:
- a minimalistic and intuitive GUI (X11 or gtkmm)
- works for any standard Xorg touchscreen driver (uses XInput to get axis valuators)
- mis-click detection (prevents bogus calibration)
- can output the calibration in xorg.conf, FDI and udev format
- can dynamically recalibrate the evdev driver
- and more

see http://www.freedesktop.org/wiki/Software/xinput_calibrator

OPTIONS

-h, --help
Print a help message listing the version and available options.
-v, --verbose
Print debug messages during the process.
--list
List the calibratable input devices.
--device device_name_or_id
Select a specific device to calibrate; use --list to list the calibratable input devices.
--precalib min_x max_x min_y max_y
Manually provide the current calibration setting.
This is usefull if the calibration values are stored in your xorg.conf, but the driver does not export them through XInput (eg. the calibrator can not know these values)
--misclick nr_of_pixels
set the misclick threshold (0=off, default: 15 pixels)
--fake
Emulate a fake driver (for testing purposes)
Usefull to test the calibrator without applying the values, and possibly even without having a touchscreen.

USAGE

Run xinput_calibrator in a terminal, as it prints out the calibration values and instructions on standard output.

The calibrator merely computes the new calibration. In case you use the evdev driver, it will also apply the new calibration for this session. To make the calibration permanent across X restarts, you need to save the calibration somewhere.

The calibrator outputs the following 4 alternatives, with the correct values filled in:

xorg.conf (the traditional way)
edit /etc/X11/xorg.conf and add in the 'Section "InputDevice"' of your device:
If using the EVDEV driver:
       Option  "Calibration"   "min_x max_x min_y max_y"

       Option  "SwapAxes"      "swap_xy"

Else (evtouch or other driver):
       Option  "MinX"          "min_x"

       Option  "MaxX"          "max_x"

       Option  "MinY"          "min_y"

       Option  "MaxY"          "max_y"

       Option  "SwapXY"                "swap_xy"
udev rule (the new way)
create the file '/etc/udev/rules.d/99_touchscreen.rules' with:
       ACTION!="add|change", GOTO="xorg_touchscreen_end"

       KERNEL!="event*", GOTO="xorg_touchscreen_end"

       ATTRS{product}!="Name_Of_TouchScreen", GOTO="xorg_touchscreen_end"

       ENV{x11_options.minx}="min_x"

       ENV{x11_options.maxx}="max_x"

       ENV{x11_options.miny}="min_y"

       ENV{x11_options.maxy}="max_y"

       ENV{x11_options.swapxy}="swap_xy"

       LABEL="xorg_touchscreen_end"

Name_Of_TouchScreen is the sysfs name of the device, use 'udevadm' to find it.

HAL policy (the old way)
create the file '/etc/hal/fdi/policy/touchscreen.fdi' with:
       <match key="info.product" contains="Name_Of_TouchScreen">

        <merge key="input.x11_options.minx" type="string">min_x</merge>

        <merge key="input.x11_options.maxx" type="string">max_x</merge>

        <merge key="input.x11_options.miny" type="string">min_y</merge>

        <merge key="input.x11_options.maxy" type="string">max_y</merge>

        <merge key="input.x11_options.swapxy" type="string">swap_xy</merge>

       </match>

Name_Of_TouchScreen is the sysfs name of the device, use 'lshal' to find it.

xinput commands, EVDEV only (the manual way)
If you use the recommended 'evdev' xserver driver, you can use the xinput tool:
       xinput set-int-prop "Name_Of_TouchScreen" "Evdev Axis Calibration" 32 min_x max_x min_y max_y

       xinput set-int-prop "Name_Of_TouchScreen" "Evdev Axes Swap" 8 swap_xy

Name_Of_TouchScreen is the xserver name or id of the device, use 'xinput list' to find it.

TROUBLESHOOTING

Run the calibrator with the -v option, it will tell you what happens and what goes wrong.

mis-click detection The calibrator can automatically detect clicks with unreasonable values. This prevents you from ending up with a bogus calibration.

If you keep getting the message 'Mis-click detected, restarting...', one of the following is happening:
  1. you are bad at clicking on crosses, use a stylus or increase the --misclick threshold
  2. your device is not properly supported by the kernel, it interprets the clicks wrong
  3. your screen has a non-linear deformation, 4-point calibration can not help you

EXAMPLES

To run the calibrator, type in your terminal:


    xinput_calibrator

If something goes wrong, or not as expected, turn on verbose messages:


    xinput_calibrator -v

If you have to manually provide the current calibration values (when using EVDEV, you can use this to reset the calibration first):


    xinput_calibrator --precalib 0 1000 0 1000

SEE ALSO

xinput(1)

scripts/xinput_calibrator_pointercal.sh an example script used on mobile devices to set the calibration on X start, using evdev and the 'xinput' tool.

AUTHORS

 Tias Guns <tias@ulyssis.org>