我正在尝试从运行示例 QtQuick2 代码的eGalax resistive touch device eglfs 窗口获取触摸输入。我失败了几天。触摸屏通过USB连接到Raspberry Pi B,适用于raspbian jessie桌面。但是,如果我运行示例QtQuick2代码,应用程序不会获得任何触摸输入。但是,使用鼠标可以很好地处理示例代码。
我已经尝试使用tsLib,但是对于x和y坐标,ts_test总是显示0。 我也尝试使用“./samplecode -plugin evdevtouch:/ dev / input / event1”但没有成功。如果触摸屏幕输出“未处理的MSC事件代码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
运行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 ------------
也许任何人都有我的线索。谢谢你的帮助。
答案 0 :(得分:0)
与相对较新的内核一起使用时,tslib中存在一个与您的触摸屏设备相关的错误。如果你使用最新的版本1.15-rc2,很快就会在你的ts.conf中使用1.15和module_raw input
,那么事情应该对你有用。