IMDTouchKnowledge BaseShop main store

Troubleshooting

Why a capacitive touchscreen cursor is offset by 1 cm

HMI and touchscreens Published 7 min read

Short answer

A projected-capacitive controller reports absolute coordinates against the glass and has no user calibration, so a constant 1 cm offset is almost always a wrong transform between the touch coordinate space and the framebuffer. Measure the error at four corners and the centre, then fix output binding, video mode or the libinput calibration matrix in that order.

On this page
  1. Is a 1 cm cursor offset really touch drift?
  2. What should I measure before changing any setting?
  3. Is the touch device bound to the wrong display?
  4. Does the video mode put the image where the touch grid expects it?
  5. What do the raw touch coordinates say?
  6. How do I apply and persist the calibration matrix?
  7. Which fix fits the measurement I recorded?
  8. Questions asked

A constant 1 cm offset between fingertip and cursor on a projected-capacitive touchscreen is almost never a calibration problem, because the controller has no user calibration at all: it carries a factory coordinate map in firmware and reports absolute positions over the full HID range, whatever the host does with them. The touch report is correct; the transform between the touch coordinate space and the framebuffer is not. Work it as a sequence of measurements, not driver installs: one five-point test branches to an origin shift, a scale error, a rotation mismatch, or a grounding fault, and each branch has exactly one fix.

Is a 1 cm cursor offset really touch drift? #

No: a projected-capacitive controller carries its coordinate map in firmware and reports absolute positions over the full 0–32767 HID range, so a fixed 1 cm gap means the report is right and the transform into screen space is wrong. Nothing you touch on the host can make this sensor drift, and the vendor driver class for these panels exposes display binding but no calibration adjustment — which is why your search for a calibration tool came back empty. Real drift — a reading that moves with temperature, wear or pressure — belongs to resistive technology, and it is covered separately in touch calibration fails or drifts: separate the real causes. Treat this fault as a mapping problem from the start.

What should I measure before changing any setting? #

Touch the four corners and the centre, and record the direction and size of the error at each point without averaging; that single record routes you to the correct branch and takes under a minute. Averaging hides the pattern — the shape of the error is the diagnosis.

What the five touches show Mechanism Fix lives in
Same offset, same direction, everywhere Origin shift: the image sits displaced inside the glass (overscan border, scaler position) Video mode
Zero at the left edge, growing to the right Scale error: touch mapped onto a coordinate space wider than this output Display binding
Horizontal error only, vertical correct Aspect mismatch: a non-native mode stretched or pillarboxed Video mode
Cursor mirrored, or X and Y swapped Rotation applied to the output but not the input device Calibration matrix
Accurate centre, wrong within 20–30 mm of the bezel Grounding or mounting, not mapping Raw coordinates
Jumps or jitters under a stationary finger Chassis or supply grounding Raw coordinates

Is the touch device bound to the wrong display? #

An absolute touch device with no output binding stretches across the whole virtual desktop, so with two side-by-side 1920-pixel outputs a touch at the panel's right edge reports x = 3840 instead of 1920, and every intermediate point is off by a proportional amount. That is a small error near the left edge and a large one near the right — the scale-error row of the table.

Enumerate the device and the outputs:

  1. xinput list — note the panel's device id.
  2. xrandr --listmonitors — note which output name the panel is.
  3. Bind them: xinput map-to-output <device-id> <output-name>.
  4. Retest the four corners. If the error collapses to zero, the binding was the whole fault.

The same logic applies on a Windows host: open the touch driver's control panel, select Display, check the Multiple Display option, then double-click the monitor that is the touch surface. For a clean test, duplicate the displays first so extended-desktop geometry cannot contaminate the measurement. If the error is unchanged and identical at every corner after binding, you have an origin shift — move on.

Does the video mode put the image where the touch grid expects it? #

The controller always reports against the physical glass, so any border the video path adds becomes cursor error: a 56-pixel overscan border on a 15.6-inch, 1920-wide panel is 10 mm in one direction, everywhere — your symptom exactly. The arithmetic: a 15.6-inch 16:9 panel is about 345 mm of active width, so 345 mm ÷ 1920 px ≈ 0.18 mm per pixel, and 56 px × 0.18 mm/px ≈ 10 mm.

Check and fix the mode:

  1. Read the active mode with xrandr --current and compare it with the panel's native resolution from its datasheet.
  2. Force the native mode explicitly instead of trusting EDID negotiation. A stretched non-native mode gives proportional error; a centred, bordered one gives constant error.
  3. On Raspberry Pi OS derived images, open /boot/config.txt, set disable_overscan=1, and remove any overscan_left, overscan_right, overscan_top, overscan_bottom, framebuffer_width and framebuffer_height entries.
  4. Reboot and confirm the desktop background reaches all four corners of the glass. A visible black border of any width is the offset you are chasing.

Fix the video path before touching any matrix: a matrix that compensates for overscan breaks the moment the mode changes.

What do the raw touch coordinates say? #

Run sudo evtest on the panel's event device and touch each corner: the ABS_X and ABS_Y values should approach the axis minimum and maximum the device declares, and a corner reading 5–10% short of the maximum means the controller's own map is short — no host-side setting corrects that. Two hardware causes produce that signature, plus the jitter case:

  1. Grounding. A floating chassis or an ungrounded supply lets the sensing reference drift and pulls the reported centroid, usually worst near a metal bezel. Bond the monitor frame to the panel's protective earth before chasing anything else: on a mains-powered station a floating chassis is a shock and noise hazard, not just a cursor problem.
  2. Mounting. A metal cut-out closer than the gasket allows, or a conductive gasket pressed against the active area, drags the centroid toward the frame. Free the gasket, reseat the panel, retest.
  3. If the raw corner values are still short with the monitor free-standing and properly earthed, the sensor is at fault and the unit goes back for warranty. When an aging panel is out of warranty instead, replace it with one of the industrial touchscreen monitors that matches the existing cut-out.

How do I apply and persist the calibration matrix? #

libinput accepts a 3×3 affine matrix in normalised 0–1 screen space through its libinput Calibration Matrix property, and it is the last step, applied only after binding, video mode and raw reports all check out. Measure the residual first: touch the extreme left edge and note the cursor's fractional position x0, then the extreme right edge for x1. A worked example: x0 = 0.02 and x1 = 0.96 give

  • a = 1 / (x1 − x0) = 1 / 0.94 = 1.0638
  • c = −x0 / (x1 − x0) = −0.02 / 0.94 = −0.0213

Repeat vertically for e and f; this example assumes the same residual both axes. Apply it live:

xinput set-prop '<device name>' 'libinput Calibration Matrix' 1.0638 0 -0.0213 0 1.0638 -0.0213 0 0 1

For a pure 90° rotation mismatch, apply 0 -1 1 1 0 0 0 0 1 and re-measure rather than deriving offsets by hand. Retest the corners; a residual of a millimetre or two is normal digitizer noise, not a failed matrix.

The live property dies on USB replug and session restart, so persist it as a udev property that is reapplied whenever the device enumerates. Create /etc/udev/rules.d/99-touch-calibration.rules:

ACTION=="add", SUBSYSTEM=="input", ENV{ID_INPUT_TOUCHSCREEN}=="1", ENV{LIBINPUT_CALIBRATION_MATRIX}="1.0638 0 -0.0213 0 1.0638 -0.0213"

The udev property carries six values, not nine — the bottom row is implied. Narrow the match to the one device with the vendor and product IDs from udevadm info -a /dev/input/eventX if the station has more than one touch surface, then reload with sudo udevadm control --reload-rules && sudo udevadm trigger. Writing that rule needs root; when the operator account cannot, the workaround is in running touch calibration without administrator rights on a panel PC. Persist the output binding the same way, from the session's autostart script, since xinput map-to-output needs the running desktop.

Which fix fits the measurement I recorded? #

The branch you measured in the five-point test dictates the single fix: constant offset means video mode, edge-growing error means display binding, mirror means rotation, and bezel-only error means grounding or replacement. Committed, case by case:

  • Same offset everywhere: force the native video mode and remove overscan. If the mode is already native with no border, put the residual into the matrix offset terms.
  • Zero at one edge, growing across: bind the device to its output. On a single-display host with the error still growing, the matrix scale terms carry it.
  • Horizontal only: set the native aspect; do not matrix your way out of a stretched mode.
  • Mirrored or transposed: apply the 90° rotation matrix and re-measure.
  • Wrong only near the bezel, or jitter under a still finger: bond the frame to protective earth, fix the gasket and cut-out clearance, then retest. Raw corner values still short means the panel goes back — replace it rather than masking a bad sensor with a matrix.

Questions asked

Why does xinput_calibrator appear to do nothing on this panel?

That tool writes an evdev axis calibration property left over from the four-point resistive era, and libinput ignores it, so the cursor never moves. Apply the residual through the libinput calibration matrix property instead; its udev form is the version that survives replug and restart.

Will a Windows host show the same fault?

Yes, and the causes are the same three. Windows offers no per-device matrix like libinput, so the fix there is binding the touch surface to one monitor in the touch driver's control panel, Display page, Multiple Display option, then forcing the panel's native video mode. A residual after both points to the raw map, and that is a warranty case.

Is this procedure right for a resistive overlay?

No. A resistive overlay genuinely drifts with wear and temperature and exposes its own calibration through its USB controller, so recalibrating it is the correct first move there. A projected-capacitive panel has no equivalent user adjustment, which is why the search for a calibration tool on it ends empty.

Does the fix work under a Wayland session?

The live property set with xinput applies only to an X session and dies on USB replug. The udev calibration property is read by libinput whenever the device enumerates, so it works under Wayland compositors too, where xinput itself has no effect. Output binding under Wayland is set through the compositor's own display mapping.

Keep reading

  • Troubleshooting

    Why Capacitive Touch Buttons Miss Presses Near Screen Edges

    Most first-press misses on a capacitive HMI happen because the controller's estimated finger center lands a few millimeters outside the software button's hit-test bounds, especially near screen edges. Log the reported coordinates during a held press: if they fall outside the button, enlarge the pressable region by the logged offset. Only when the touch count stays zero during contact should you chase grounding, polling or hardware.

    HMI and touchscreens

  • Troubleshooting

    Touch calibration fails or drifts: separate the real causes

    If calibration fails repeatedly, the fault is usually the calibration tool, its driver or session state, not the touch sensor: a pass that stops with an error before the target pattern runs never changes stored coordinates. Calibration persists until firmware changes, so test several touch targets first — one dead button is an application-event fault, and only a whole-screen offset that keeps returning is true drift.

    HMI and touchscreens

  • Selection guide

    Capacitive touchscreens with gloves in wet outdoor work

    A capacitive touchscreen can serve a gloved, wet, outdoor station, but only as a complete assembly tuned for both conditions: a projected-capacitive sensor that scans mutual and self capacitance, tuned by the supplier for your gloves, and accepted after a wet, gloved test on the finished unit. If the supplier cannot tune and retest, choose resistive behind a sealed window or hard buttons for critical actions.

    HMI and touchscreens