Calibrating touch

You can calibrate your screen using a few different mechanisms.

These are the four ways you can calibrate touch on your system that include:
  1. manual: Use the calib as a mode in the scaling configuration file. For more information, see calib option.
  2. direct mapping: This mechanism is useful if the display has a touchscreen the capability to scale values on the hardware (e.g., Atmel). For more information, see Direct mapping.”
  3. scaled: This is a mechanism that uses the screen resolution and touch display's maximum X and Y values to calculate the number of touch coordinates per display pixel. For more information, see Scaling calibration.”
  4. user-calibrated: This mechanism is used with the calib-touch utility. This method is best used for displays that have resistive screens. This method provides corrections for misaligned touch displays during the mounting process. For more information, see User Calibrated.

Direct mapping

This calibration methods is useful for touch displays that can scale values on the hardware (e.g., Atmel controller) or if user-calibrated method is used. Then the driver needs to send raw events (direct). This calibration mechanism can be used with the calib-touch utility. For more information about the calib-touch utility, see the calib-touch section in this guide.

To use this method, you do the following:
  1. Set the mode parameter to direct in the scaling configuration file (the default file is at /etc/system/config/scaling.conf).
  2. For example,if you are using an Atmel touch controller, you can adjust the maximum X and Y values using the xrange and yrange values on the T9 (Gen 3 or earlier) or the T100 (Generation 4).

Scaled calibration

This calibration method works well with Capacitive-based touch displays because once they are mounted, the values are static and don't skew over time.

To use this method, do the following:

  1. Set the mode parameter to scale in the scaling configuration file (the default file is at /etc/system/config/scaling.conf).
  2. In the touch configuration file (the default location is located at (default is /etc/system/config/mtouch.conf), set width and height properties to the maximum X and Y values of the touchscreen. These X and Y values can be fetched from sloginfo output while in verbose mode. For example, if you have a touchscreen that has a maximum X and Y of 4096 with a display running at 1024x768, here's what your configuration may look like:
    begin mtouch
       driver=name_of_your_driver
       options=width=4096,height=4096,your_other_options
    end mtouch
It's important to mention that this method doesn't correct misaligned touch displays, but if the origin of isn't in the upper-left corner of the display, you can use the invert_x and invert_y options to reverse the directions of the coordinates. For more information, see Settings for various HID displays in the mtouch section of this guide.

User Calibrated

This calibration method is useful for resistive screens that have coordinates that skew over time.

To use this method, do the following:

  1. Set the mode parameter to direct in the scaling configuration file (the default file is at /etc/system/config/scaling.conf).
  2. After the touch driver and Screen service successfully run, start the calib-touch utility. After Screen completes running, a calibration file is created that's loaded into Screen's translation matrix. For more information about the calib-touch utility, see calib-touch section in this guide.