Touchscreen rotation causes 2 touch events
-
Hello!
I have a weird problem with Qt 6.2.2 QML. I have a portrait display that is running QML in landscape (Loader is rotated by 90 degrees). The issue is that touch scrolling events are not rotated properly so I am trying to rotate the touchscreen by this export:
QT_QPA_GENERIC_PLUGINS=evdevtouch:/dev/input/event0:rotate=90
But the issue is, then I have 2 touch events - one is non-rotated previous one and then another one, which is corrected - rotated. This is the QPA log I have, which shows only when I have the rotation enabled:
qt.qpa.input.events: reporting TouchPoint(1255 @QRectF(455.993,767.966 22.0344x22.0344) normalized QPointF(0.974969,0.974948) press 1 vel QVector2D(0, 0) state 1 point is not in activePoints QEventPoint(id=0 ts=99725 pos=8,13 scn=467,20 gbl=467,20 Pressed ellipse=(8x8 ∡ 0) vel=0,0 press=8,13 last=8,13 Δ 0,0) qt.qpa.input.events: reporting TouchPoint(1255 @QRectF(455.993,767.966 22.0344x22.0344) normalized QPointF(0.974969,0.974948) press 0 vel QVector2D(0, 0) state
So now the problem is - how can I get rid of the non-rotated touch events? I want only the rotated touch events.
-
To resolve the dual touch event issue in Qt QML, you might need to disable the native touch event handling and manage the rotation programmatically within your application. Consider using QTouchEvent and QTransform to apply a custom rotation to the touch events. Additionally, ensure that only one touch input device is active to prevent duplicate events.