2017-11-25 135 views
0

我试图从eGalax resistive touch deviceeglfs窗口中运行样品QtQuick2代码得到触摸输入。我失败了好几天。触摸屏通过USB连接到Raspberry Pi B,并且适用于raspbian jessie桌面。但是如果我运行示例QtQuick2代码,应用程序不会得到任何触摸输入。但是,使用鼠标可以很好地处理示例代码。无法从eGalax设备触摸输入QtQuick应用

我已经尝试使用tsLib,但ts_test显示x和y坐标始终为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 /输入/事件1" ,但在这里它可以移动鼠标光标

一些有用的信息 的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(在我看来似乎很好):

[email protected]:~ $ 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 ------------ 

也许a尼永对我有一点线索。谢谢你的帮助。

回答

0

与相对较新的内核一起使用时,您的触摸屏设备特有的tslib中存在一个错误。如果你使用最新版本的1.15-rc2,很快就会在你的ts.conf文件中变成1.15和module_raw input,那么事情应该对你来说很好。

+0

完美!这对我来说很好。 –