我試圖從eGalax resistive touch device到eglfs窗口中運行樣品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尼永對我有一點線索。謝謝你的幫助。
完美!這對我來說很好。 –