Touch Rotation with 10″ Display from Joy-IT

I got myself a 10″ multi-touch display from Joy-IT for my Raspberry. I’m quite satified with the display, it has a relatively high resolution, very good display quality, good viewing angle, and touch works very well – the necessary driver is included in Raspbian. Two things that could be better: The backlight is not software-controllable, and the position of the HDMI and USB connectors is not optimal.

In the end I want to use the display mounted vertically in a wall, so I included the line

into /boot/config.txt. Unfortunately this only rotates the display, not the touch input, so the mouse is not following the touch. The line lcd_rotate=3, which would turn both display and touch, only works for the official Raspberry Foundation display. The methods described in my 3.2″ Touch Display Quick Guide do not work with this screen either. First, because tslib does not know how to handle the multitouch, and second: the SwapAxes line is also not recognised.

Still, /usr/share/X11/xorg.conf.d/99-calibration.conf is the key to success:

That does the trick, also on brand-new Raspbian Stretch. For more details on the transformatin matrix, also for other rotations, go here.

2 thoughts on “Touch Rotation with 10″ Display from Joy-IT

  1. I had the following situation:

    The screen was rotated anticlockwise 90 degrees with Raspberry Pi. Changed display_rotate=1 in /boot/config.txt configuration file and restarted the machine.

    So now the display was showing correct, but the touchscreen was not functioning as I wanted.

    Then ran the following command:

    xinput set-prop “eGalax Inc. USB TouchController” “Evdev Axes Swap” 1

    What this command does, it swaps the X and Y axes of the touchscreen. Because the display was rotated anticlockwise 90 degrees, these X and Y had to be rotated too. This same would apply if rotation was done clockwise 90 degrees.

    After this, the following command was ran :

    xinput_calibrator

    This program creates the calibration data, that had be saved in configuration file in directory /usr/share/X11/xorg.conf.d/ with name 99-calibration.conf. This calibration file name can actually be anything as long as it starts with a numeric value which tells in which order it is read and must have extension .conf.

    Note: The most important thing was to first swap the X and Y axes of the touchscreen. Without swapping axes, the xinput_calibrator gives wrong calibration data. I have not investigated this any deeper, but this is what I found out when solving calibration issue with display connected to Raspberry Pi.

    These instructions can probably be applied to any Linux operating system that needs to have the touchscreen calibrated using xinput_calibrator and the touch screen is a resistive type.

    1. Hi Marko,
      thanks for sharing your insights!
      You can btw. include the axis swap also in the 99-calibration.conf as Option "SwapAxes" "1" (cf. eg. my other post on rotating screens). Or, above in this post, the axis swap is “encoded” in the TransformationMatrix (cf. this documentation).
      Happy rotating 🙂
      Hauke

Leave a Reply

Your email address will not be published. Required fields are marked *