Qt 5.11: сенсорный ввод инвертирован в моем приложении - PullRequest
0 голосов
/ 16 октября 2018

Я развертываю приложение Qt на черном цвете beaglebone, на котором работает Stretch.Я пытаюсь использовать linuxfb с libinput для обработки сенсорных событий.Ввод с сенсорного экрана был инвертирован, поэтому я установил матрицу преобразования координат с помощью файла .conf.Сенсорный экран корректно работает на рабочем столе, но все еще инвертируется в моем приложении Qt.

Вот мои настройки среды для Qt:

QT_LOGGING_RULES=*=true
QT_QPA_EGLFS_HEIGHT=600
QT_QPA_EGLFS_PHYSICAL_HEIGHT=92
QT_QPA_EGLFS_PHYSICAL_WIDTH=155
QT_QPA_EGLFS_WIDTH=1024
QT_QPA_FB_DRM=1
QT_QPA_PLATFORM=linuxfb

При указанных выше настройках приложение отображается правильно иотзывчив, но сенсорный ввод инвертирован.

Вот вывод консоли Qt при работе со следующими параметрами:

11:24:44: Checking available ports...
11:24:44: Found 101 free ports.
11:24:44: Starting /usr/bin/gdbserver...
11:24:44: Debugging starts

Listening on port 10000
Remote debugging from host 192.168.13.104
Process /home/debian/test created; pid = 1473
qt.qpa.eglfs.kms: Using backend-provided DRM device /dev/dri/card0
qt.qpa.fb: DRM device /dev/dri/card0 opened
qt.qpa.eglfs.kms: Found 1 planes

qt.qpa.eglfs.kms: plane 0: id = 18 countFormats = 2 possibleCrtcs = 0x1 supported formats = XR24 AR24 
qt.qpa.eglfs.kms:   property 0: id = 5 name = 'type'
qt.qpa.eglfs.kms:   type is ENUM, value is 1, possible values are:
qt.qpa.eglfs.kms:     enum 0: Overlay - 0
qt.qpa.eglfs.kms:     enum 1: Primary - 1
qt.qpa.eglfs.kms:     enum 2: Cursor - 2
qt.qpa.eglfs.kms: "LVDS1" mode count: 1 crtc index: 0 crtc id: 19
qt.qpa.eglfs.kms: mode 0 1024 x 600 @ 45 hz
qt.qpa.eglfs.kms: Selected mode 0 : 1024 x 600 @ 45 hz for output "LVDS1"
qt.qpa.eglfs.kms: Physical size is QSizeF(155, 92) mm for output "LVDS1"
qt.qpa.eglfs.kms: Output LVDS1 can use 1 planes: 18 
qt.qpa.fb: Got a new output: LVDS1

qt.qpa.eglfs.kms: Sorted screen list: QVector()
qt.qpa.fb: Got a dumb buffer for size 1024x600 and bpp 32: handle 1, pitch 4096, size 2457600
qt.qpa.fb: FB is 25 (DRM format 0x34325258), mapped at 0xb364d000

qt.qpa.fb: Got a dumb buffer for size 1024x600 and bpp 32: handle 2, pitch 4096, size 2457600
qt.qpa.fb: FB is 26 (DRM format 0x34325258), mapped at 0xb33f5000
qt.qpa.fb: QRect(0,0 1024x600) QSizeF(155, 92) 24 4
qt.qpa.input: libinput: input device 'gpio_keys', /dev/input/event2 is tagged by udev as: Keyboard
qt.qpa.input: libinput: input device 'gpio_keys', /dev/input/event2 is a keyboard
qt.qpa.input: libinput: input device 'tps65217_pwr_but', /dev/input/event0 is tagged by udev as: Keyboard
qt.qpa.input: libinput: input device 'tps65217_pwr_but', /dev/input/event0 is a keyboard
qt.qpa.input: libinput: input device 'DELL Dell USB Entry Keyboard', /dev/input/event3 is tagged by udev as: Keyboard
qt.qpa.input: libinput: input device 'DELL Dell USB Entry Keyboard', /dev/input/event3 is a keyboard

qt.qpa.input: libinput: input device 'SIGMACHIP Usb Mouse', /dev/input/event4 is tagged by udev as: Mouse
qt.qpa.input: libinput: input device 'SIGMACHIP Usb Mouse', /dev/input/event4 is a pointer caps
qt.qpa.input: libinput: input device 'EP0790M09', /dev/input/event1 is tagged by udev as: Touchscreen

qt.qpa.input: libinput: input device 'EP0790M09', /dev/input/event1 is a touch device
qt.qpa.input: Using xkbcommon for key mapping

Я также пробовал его с этими настройками среды:

DISPLAY=:0
QT_LOGGING_RULES=*=true
QT_QPA_EGLFS_HEIGHT=600
QT_QPA_EGLFS_INTEGRATION=eglfs_x11
QT_QPA_EGLFS_PHYSICAL_HEIGHT=92
QT_QPA_EGLFS_PHYSICAL_WIDTH=155
QT_QPA_EGLFS_WIDTH=1024
XAUTHORITY=/home/debian/.Xauthority

Используя эту конфигурацию,Я могу запустить приложение только в том случае, если на beaglebone запущена голая xsession.Приложение рендерится правильно, но оно запаздывает, а касание по-прежнему переворачивается.

Вот вывод консоли Qt для этой конфигурации:

11:26:52: Checking available ports...
11:26:52: Found 101 free ports.
11:26:52: Starting /usr/bin/gdbserver...
11:26:52: Debugging starts

Listening on port 10001
Remote debugging from host 192.168.13.104
Process /home/debian/test created; pid = 1893
qt.qpa.egldeviceintegration: EGL device integration plugin keys: ("eglfs_emu", "eglfs_kms_egldevice", "eglfs_kms", "eglfs_x11")
qt.qpa.egldeviceintegration: EGL device integration plugin keys (sorted): ("eglfs_x11", "eglfs_emu", "eglfs_kms_egldevice", "eglfs_kms")
qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_x11"

qt.qpa.egldeviceintegration: Using EGL device integration "eglfs_x11"
libEGL warning: DRI2: failed to authenticate
qt.qpa.input: libinput: input device 'gpio_keys', /dev/input/event2 is tagged by udev as: Keyboard
qt.qpa.input: libinput: input device 'gpio_keys', /dev/input/event2 is a keyboard
qt.qpa.input: libinput: input device 'tps65217_pwr_but', /dev/input/event0 is tagged by udev as: Keyboard
qt.qpa.input: libinput: input device 'tps65217_pwr_but', /dev/input/event0 is a keyboard

qt.qpa.input: libinput: input device 'DELL Dell USB Entry Keyboard', /dev/input/event3 is tagged by udev as: Keyboard
qt.qpa.input: libinput: input device 'DELL Dell USB Entry Keyboard', /dev/input/event3 is a keyboard

qt.qpa.input: libinput: input device 'SIGMACHIP Usb Mouse', /dev/input/event4 is tagged by udev as: Mouse
qt.qpa.input: libinput: input device 'SIGMACHIP Usb Mouse', /dev/input/event4 is a pointer caps

qt.qpa.input: libinput: input device 'EP0790M09', /dev/input/event1 is tagged by udev as: Touchscreen
qt.qpa.input: libinput: input device 'EP0790M09', /dev/input/event1 is a touch device
qt.qpa.input: Using xkbcommon for key mapping


Running on a software rasterizer (LLVMpipe), expect limited performance.
qt.opengl.diskcache: GL_ARB_get_program_binary support = 1
qt.opengl.diskcache: Supported binary format count = 0
qt.opengl.diskcache: Shader cache supported = 0

Вот мой .conf, который применяется к сенсорному экрану:

Section "InputClass"
    Identifier      "calibration"
    MatchProduct    "EP0790M09"
    MatchDevicePath "/dev/input/event*"
    Driver  "libinput"
    Option          "TransformationMatrix"  "-1.0 0.0 1.0 0.0 -1.0 1.0 0.0 0.0 1.0"
EndSection

Вот что такое xinputсписки для свойств устройства:

Device 'EP0790M09':
Device Enabled (115):   1
Coordinate Transformation Matrix (116): -1.000000, 0.000000, 1.000000, 0.000000, -1.000000, 1.000000, 0.000000, 0.000000, 1.000000
libinput Calibration Matrix (270):  1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Calibration Matrix Default (271):  1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Send Events Modes Available (272): 1, 0
libinput Send Events Mode Enabled (273):    0, 0
libinput Send Events Mode Enabled Default (274):    0, 0
Device Node (236):  "/dev/input/event1"
Device Product ID (235):    0, 0

Информация о версии:

$lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 9.5 (stretch)
Release:    9.5
Codename:   stretch

$ uname -a
Linux beaglebone 4.4.9 #2 SMP Thu Mar 22 13:59:11 CDT 2018 armv7l GNU/Linux

Как я могу инвертировать сенсорный ввод внутри моего приложения qt?

1 Ответ

0 голосов
/ 18 октября 2018

В итоге было решено использовать evdev touch в моем приложении и использовать QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS для исправления событий ввода.

Моя среда окончательного запуска оказалась:

QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event1:rotate=180
QT_QPA_FB_NO_LIBINPUT=1
QT_QPA_PLATFORM=linuxfb
...