# Touchscreen rotation using ROM-DK2620

**URL:** <https://forum.aim-linux.advantech.com/t/touchscreen-rotation-using-rom-dk2620/904>\
**Category:** Technical Supports\
**Created:** [November 27, 2024, 5:12pm UTC](https://forum.aim-linux.advantech.com/t/touchscreen-rotation-using-rom-dk2620/904 "2024-11-27T17:12:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scott\_Ellis](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@Scott\_Ellis](https://forum.aim-linux.advantech.com/u/Scott_Ellis)\
**Post date:** [November 27, 2024, 5:12pm UTC](https://forum.aim-linux.advantech.com/t/touchscreen-rotation-using-rom-dk2620/904/1 "2024-11-27T17:12:07Z")

</div>

I have a Qt6 app running on the board with the 800x480 display that come with the dev kit. I can rotate the display with a Qt env var QT\_QPA\_EGLFS\_ROTATION=90, but how do I rotate the USB attached touchscreen controller?

---

<div class="post-metadata">

**Author:** ![Jems\_Cheng](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@Jems\_Cheng](https://forum.aim-linux.advantech.com/u/Jems_Cheng)\
**Post date:** [November 28, 2024, 7:26am UTC](https://forum.aim-linux.advantech.com/t/touchscreen-rotation-using-rom-dk2620/904/2 "2024-11-28T07:26:06Z")

</div>

Hi~  
From our experience, there is a calibration tool provided by the touch vendor that can calibrate the position, or it may have a config file that can set the position of the touch sensor. Please contact the touch vendor to get further support.

---

<div class="post-metadata">

**Author:** ![Scott\_Ellis](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@Scott\_Ellis](https://forum.aim-linux.advantech.com/u/Scott_Ellis)\
**Post date:** [December 2, 2024, 6:38pm UTC](https://forum.aim-linux.advantech.com/t/touchscreen-rotation-using-rom-dk2620/904/3 "2024-12-02T18:38:56Z")

</div>

The solution I am using consists of using QT to rotate the display output and a udev libinput rule to adjust the touchscreen orientation.

A combination of this for the UI display  
**export QT\_QPA\_EGLFS\_ROTATION=-90**  
and this for the touchscreen in /etc/udev/rules.d/touchscreen.rules  
**SUBSYSTEM==“input”, KERNEL==“event[0-9]\*”, ENV{ID\_INPUT\_TOUCHSCREEN}==“1”, ENV{LIBINPUT\_CALIBRATION\_MATRIX}=“0 -1 1 1 0 0”**

Or this to flip the other way  
**export QT\_QPA\_EGLFS\_ROTATION=90**  
and  
**SUBSYSTEM==“input”, KERNEL==“event[0-9]\*”, ENV{ID\_INPUT\_TOUCHSCREEN}==“1”, ENV{LIBINPUT\_CALIBRATION\_MATRIX}=“0 1 0 -1 0 1”**
