1

I have an HP laptop with a 1366x768 tactile screen. I need to run some kiosk software which needs a resolution of 800x600, so I set it with xrandr:

xrandr --output eDP-1 --mode 800x600

It looks good, looks like xrandr has added black bars at both sides of the screen to keep the aspect ratio.

The problem arises when I touch the screen. The further I touch from the center of the screen, the more off the cursor is. Looks like when I touch the screen it takes into account the side black bars to calculate where the cursor should be. Say I touch 25% into the physical screen, the cursor is placed 25% into the visible screen, so it does align.

I tried using this link to calibrate the touchscreen, but it makes no difference at all.

8
  • In the linked solution, the problem is different. In their example, the touch area is smaller than the total display area and they map the whole touchscreen to a portion of the display area. In your case, you want to map a portion of the touch area to the smaller display area. I'm not sure if that is (accurately) achievable using the transformation matrix. Please tell us which commands you already tried that didn't work.
    – danzel
    Jun 15, 2018 at 11:25
  • I tried using xrandr with various options (like panning, but it does not fix anything) and also tried to create a transformation matrix following the formula in the link I provided but it makes no difference. Jun 18, 2018 at 12:14
  • Which Ubuntu version and display server (Xorg or wayland) do you use?
    – danzel
    Jun 18, 2018 at 12:39
  • Xubuntu 18.04 LTS with Xorg 2:1.19.6-1ubuntu4 Jun 18, 2018 at 14:18
  • When you run xinput list-props ..., is there a property called "libinput Calibration Matrix"?
    – danzel
    Jun 18, 2018 at 15:14

1 Answer 1

1

As you already found out yourself, the mapping from touch screen coordinates to screen coordinates is controlled by a transformation matrix.

Usually, the system assumes that the touch screen spans the whole screen area, which is correct in most circumstances. However, if the display area is larger (e.g. multiple monitors) or smaller than the touch area, you have to modify that transformation matrix.

Traditionally, you'd have to set Coordinate Transformation Matrix via xinput. But since you are using libinput, there are two differences:

  • The xinput property is called libinput Calibration Matrix
  • The transformation matrix is calculated differently

Judging by Reinderien's post, "the proper thing is to do an inverse matrix transformation".

I honestly don't know how to do that, but fortunately he provides a script called xcal, which calibrates the touchscreen for you.

Prerequisites:

python3, tkinter, numpy (install by running sudo apt-get install python3 pyhton3-tk python3-numpy in a terminal).

Donwload xcal and execute it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .