无法从 eGalax 设备获取触摸输入到 QtQuick 应用程序

Can't get touch input from eGalax device to QtQuick application

我正在尝试将 触摸输入eGalax resistive touch device 转换为 eglfs window 运行ning 示例 QtQuick2 代码。我失败了好几天。触摸屏通过 USB 连接到 Raspberry Pi B 并且适用于 raspbian jessie 桌面。但是如果我 运行 示例 QtQuick2 代码应用程序不会获得任何触摸输入。但是,对于示例代码,使用鼠标效果很好。

我已经尝试使用 tsLib,但 ts_test x 和 y 坐标始终显示为 0。 我也尝试使用“./samplecode -plugin evdevtouch:/dev/input/event1”但没有成功。如果触摸屏幕,则打印输出 "Unhandled MSC event code MSC_SCAN (0x4)"。因此,应用程序或鼠标光标没有响应。

QML debugging is enabled. Only use this in a safe environment. qt.qpa.egldeviceintegration: EGL device integration plugin keys: ("eglfs_brcm", "eglfs_kms") 
qt.qpa.egldeviceintegration: EGL device integration plugin keys (sorted): ("eglfs_brcm", "eglfs_kms") 
qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_brcm" qt.qpa.egldeviceintegration: Using EGL device integration "eglfs_brcm" 
Unable to query physical screen size, defaulting to 100 dpi. 
To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters). 
qt.qpa.input: libinput: input device 'eGalax Inc. Touch', /dev/input/event0 is tagged by udev as: Mouse 
qt.qpa.input: libinput: input device 'eGalax Inc. Touch', /dev/input/event0 is a pointer caps 
qt.qpa.input: libinput: input device 'eGalax Inc. Touch', /dev/input/event1 is tagged by udev as: Tablet 
qt.qpa.input: libinput: eGalax Inc. Touch: tablet unknown to libwacom qt.qpa.input: libinput: input device 'eGalax Inc. Touch', /dev/input/event1 is a tablet 
qt.qpa.input: Using xkbcommon for key mapping 
qt.qpa.input: evdevtouch: Adding device at "/dev/input/event1" 
qt.qpa.input: evdevtouch: Using device /dev/input/event1 
qt.qpa.input: evdevtouch: /dev/input/event1: Protocol type B (mtdev) (multi) qt.qpa.input: evdevtouch: /dev/input/event1: min X: 0 max X: 0 
qt.qpa.input: evdevtouch: /dev/input/event1: min Y: 0 max Y: 0 
qt.qpa.input: evdevtouch: /dev/input/event1: min pressure: 0 max pressure: 0 qt.qpa.input: evdevtouch: /dev/input/event1: device name: eGalax Inc. Touch JIT is disabled for QML. Property bindings and animations will be very slow. Visit https://wiki.qt.io/V4 to learn about possible solutions for your platform.
qt.qpa.input: evdevtouch: Updating QInputDeviceManager device count: 1  touch devices, 0 pending handler(s) 
qt.qpa.input: libinput: Unhandled MSC event code MSC_SCAN (0x4) 
qt.qpa.input: libinput: Unhandled MSC event code MSC_SCAN (0x4) 
qt.qpa.input: libinput: Unhandled MSC event code MSC_SCAN (0x4) 
qt.qpa.input: libinput: Unhandled MSC event code MSC_SCAN (0x4)

与使用 ./samplecode -plugin evdevmouse:/dev/input/event1" 相同,但这里可以移动鼠标光标。

一些有用的信息 dmesg:

usb 1-1.3: New USB device found, idVendor=0eef, idProduct=0001 
usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0 
usb 1-1.3: Product: Touch 
usb 1-1.3: Manufacturer: eGalax Inc. 
systemd[1]: Expecting device dev-ttyAMA0.device... 
systemd[1]: Starting Forward Password Requests to Wall Directory Watch. systemd[1]: Started Forward Password Requests to Wall Directory Watch. 
input: eGalax Inc. Touch as /devices/platform/soc/20980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/0003:0EEF:0001.0001/input/input0 
input: eGalax Inc. Touch as /devices/platform/soc/20980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/0003:0EEF:0001.0001/input/input1 
hid-generic 0003:0EEF:0001.0001: input,hidraw0: USB HID v1.12 Pointer [eGalax Inc. Touch] on usb-20980000.usb-1.3/input0

运行ning evtest(在我看来似乎没问题):

pi@raspberrypi:~ $ evtest /dev/input/event1
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0xeef product 0x1 version 0x112
Input device name: "eGalax Inc. Touch"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 320 (BTN_TOOL_PEN)
    Event code 330 (BTN_TOUCH)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value    315
      Min        0
      Max     2047
    Event code 1 (ABS_Y)
      Value    689
      Min        0
      Max     2047
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
Event: time 1511610558.640532, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0042
Event: time 1511610558.640532, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1511610558.640532, type 3 (EV_ABS), code 0 (ABS_X), value 1362
Event: time 1511610558.640532, type 3 (EV_ABS), code 1 (ABS_Y), value 978
Event: time 1511610558.640532, -------------- EV_SYN ------------
Event: time 1511610558.672506, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0042
Event: time 1511610558.672506, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1511610558.672506, -------------- EV_SYN ------------

也许有人对我有线索。感谢您的帮助。

当与相对较新的内核一起使用时,tslib 中存在一个特定于您的触摸屏设备的错误。如果您使用最新的 1.15-rc2 版本,很快就会是 1.15,并且 module_raw input 在您的 ts.conf 中,应该可以正常工作。