I am programming a QT application which is deployed to a linux embedded system. It uses the TSLIB for touch screen, and a framebuffer VNC server. When I use the touch screen, it works just fine. However, when I use VNC, the mouse cursor on the VNC window presents a inverted x, and y axis. When I do the ts_test
, I can clearly see that the touch screen generates events with the right axis coordinates, but the cursor on the VNC viewer generates mirrored coordinate events (I tried to use different VNC clients but I did not have success). Thus, this inverted axis problem happens only when using VNC. Seems like I can solve this problem in three different ways, that is:
1 - Through QT env variables, on which I could invert the axis coming from input events (as in the documentation https://doc.qt.io/qt-6/inputs-linux-device.html).
2 - Through linux kernel, on which I could invert the output of my specific dev input event coming from the VNC (which seems to be /dev/input/Event1, could I get the exact device through a tslib command line?).
3 - Check if it is a framebuffer VNC server configuration problem (did some research but I could not find ways to do such configuration on my framebuffer VNC server).
Nonetheless, I've tried approach 1, by following the documentation mentioned, and by running the following commands (that did not work):
export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/Event1:invertx:inverty
export QT_QPA_EGLFS_DISABLE_INPUT=1
export TSLIB_TSDEVICE=/dev/touch0
export QT_QPA_EGLFS_HIDECURSOR=0
export QT_QPA_EGLFS_FORCE888=1
export QT_QPA_PLATFORM=eglfs
export QT_QPA_EGLFS_NO_LIBINPUT=1
$MY_APPLICATION_PATH -platform eglfs -plugin tslib
For approach two, I've googled how to invert x, and y coordinates coming from /dev/input devices, but still could not get it.
Could anybody help me solve this?
QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS is for the evdev plugin according to the docs. You should probably use QT_QPA_EGLFS_NO_LIBINPUT for that to be taken into consideration. However, the original problem is unclear to me, sorry.