Wacom 触摸屏产生鼠标事件

Wacom 触摸屏产生鼠标事件

我有一台 Dell Latitude 7200 2-in-1,这是一款可转换笔记本电脑,上面装有 Ubuntu 16.04。触摸屏被正确识别,我可以使用它来移动窗口并在终端仿真器中选择文本。

然而,在 Qt 应用程序中,触摸行为确实很奇怪:单击可以正常工作,但拖放工作就像我单击两次一样,一次在开始,一次在结束。

经过一些调查并与外部工作触摸屏(与 evdev 配合使用)进行比较,我发现通过运行 xinput test-xi2,集成触摸屏会产生常规的“鼠标事件”(ButtonPress、Motion 和 ButtonRelease)而不是触摸事件(TouchBegin、TouchUpdate 和 TouchEnd)。

我能做些什么 ?

xinput 集成触摸屏设置:

Device 'Wacom HID 48CC Finger touch':
        Device Enabled (140):   1
        Coordinate Transformation Matrix (142): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        Device Accel Profile (266):     0
        Device Accel Constant Deceleration (267):       1.000000
        Device Accel Adaptive Deceleration (268):       1.000000
        Device Accel Velocity Scaling (269):    10.000000
        Device Node (262):      "/dev/input/event13"
        Wacom Tablet Area (312):        0, 0, 10368, 6912
        Wacom Rotation (313):   0
        Wacom Pressurecurve (314):      0, 0, 100, 100
        Wacom Serial IDs (315): 18636, 1, 3, 0, 0
        Wacom Serial ID binding (316):  0
        Wacom Pressure Threshold (317): 0
        Wacom Sample and Suppress (318):        2, 4
        Wacom Enable Touch (319):       1
        Wacom Enable Touch Gesture (321):       1
        Wacom Touch Gesture Parameters (322):   455, 202, 250
        Wacom Tool Type (323):  "TOUCH" (330)
        Wacom Button Actions (324):     "Wacom button action 0" (325), "Wacom button action 1" (326), "Wacom button action 2" (327)
        Wacom button action 0 (325):    1572865
        Wacom button action 1 (326):    1572866
        Wacom button action 2 (327):    1572867
        Device Product ID (261):        1386, 18636
        Wacom Debug Levels (329):       0, 0

外部触摸屏,用于比较:

Device 'Weida Hi-Tech                CoolTouchR System           ':
        Device Enabled (140):   1
        Coordinate Transformation Matrix (142): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        Device Accel Profile (266):     0
        Device Accel Constant Deceleration (267):       1.000000
        Device Accel Adaptive Deceleration (268):       1.000000
        Device Accel Velocity Scaling (269):    10.000000
        Device Product ID (261):        9589, 266
        Device Node (262):      "/dev/input/event20"
        Evdev Axis Inversion (661):     0, 0
        Evdev Axis Calibration (662):   <no items>
        Evdev Axes Swap (663):  0
        Axis Labels (664):      "Abs MT Position X" (580), "Abs MT Position Y" (581), "None" (0), "None" (0)
        Button Labels (665):    "Button Unknown" (660), "Button Unknown" (660), "Button Unknown" (660), "Button Wheel Up" (146), "Button Wheel Down" (147)
        Evdev Scrolling Distance (666): 0, 0, 0
        Evdev Middle Button Emulation (667):    0
        Evdev Middle Button Timeout (668):      50
        Evdev Middle Button Button (669):       2
        Evdev Third Button Emulation (670):     0
        Evdev Third Button Emulation Timeout (671):     1000
        Evdev Third Button Emulation Button (672):      3
        Evdev Third Button Emulation Threshold (673):   20
        Evdev Wheel Emulation (674):    0
        Evdev Wheel Emulation Axes (675):       0, 0, 4, 5
        Evdev Wheel Emulation Inertia (676):    10
        Evdev Wheel Emulation Timeout (677):    200
        Evdev Wheel Emulation Button (678):     4
        Evdev Drag Lock Buttons (679):  0

集成触摸屏xinput test-xi2事件示例:

EVENT type 15 (RawButtonPress)
    device: 14 (14)
    detail: 1
    flags:
    valuators:
          0: 5688.00 (5688.00)
          1: 550.00 (550.00)
          2: 0.00 (0.00)
          3: 0.00 (0.00)
          4: 0.00 (0.00)
          5: 0.00 (0.00)

EVENT type 4 (ButtonPress)
    device: 14 (14)
    detail: 1
    flags:
    root: 1053.23/101.84
    event: 98.23/49.84
    buttons:
    modifiers: locked 0 latched 0 base 0 effective: 0
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 5688.00
        1: 550.00
        2: 0.00
        3: 0.00
        4: 0.00
        5: 0.00
    windows: root 0x194 event 0x3c00001 child 0x0
EVENT type 17 (RawMotion)
    device: 14 (14)
    detail: 0
    flags:
    valuators:
          0: 5665.00 (5665.00)
          1: 762.00 (762.00)
          2: 0.00 (0.00)
          3: 0.00 (0.00)
          4: 0.00 (0.00)
          5: 0.00 (0.00)

EVENT type 6 (Motion)
    device: 14 (14)
    detail: 0
    flags:
    root: 1048.97/140.09
    event: 93.97/88.09
    buttons: 1
    modifiers: locked 0 latched 0 base 0 effective: 0
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 5665.00
        1: 762.00
        2: 0.00
        3: 0.00
        4: 0.00
        5: 0.00
    windows: root 0x194 event 0x3c00001 child 0x3c00002
EVENT type 16 (RawButtonRelease)
    device: 14 (14)
    detail: 1
    flags:
    valuators:

EVENT type 5 (ButtonRelease)
    device: 14 (14)
    detail: 1
    flags:
    root: 1048.97/141.09
    event: 93.97/89.09
    buttons: 1
    modifiers: locked 0 latched 0 base 0 effective: 0
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
    windows: root 0x194 event 0x3c00001 child 0x3c00002

工作外部触摸屏事件样本,用于比较:

EVENT type 22 (RawTouchBegin)
    device: 20 (20)
    detail: 121
    valuators:
          0: 20730.00 (20730.00)
          1: 5477.00 (5477.00)

EVENT type 6 (Motion)
    device: 20 (20)
    detail: 0
    flags: emulated
    root: 1237.65/67.95
    event: 1172.65/43.95
    buttons:
    modifiers: locked 0 latched 0 base 0 effective: 0
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 20730.00
        1: 5477.00
    windows: root 0x194 event 0x3c00001 child 0x0
EVENT type 18 (TouchBegin)
    device: 20 (20)
    detail: 121
    flags: emulating
    root: 1214.65/213.95
    event: 1149.65/189.95
    buttons:
    modifiers: locked 0 latched 0 base 0 effective: 0
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 20730.00
        1: 5477.00
    windows: root 0x194 event 0x3c00001 child 0x3c00001
EVENT type 23 (RawTouchUpdate)
device: 20 (20)
detail: 119
valuators:
0: 12568.00 (12568.00)
1: 11399.00 (0.00)

EVENT type 19 (TouchUpdate)
device: 20 (20)
detail: 119
flags: emulating
root: 736.41/445.27
event: 671.41/421.27
buttons:
modifiers: locked 0 latched 0 base 0 effective: 0
group: locked 0 latched 0 base 0 effective: 0
valuators:
0: 12568.00
1: 11399.00
windows: root 0x194 event 0x3c00001 child 0x3c00001
EVENT type 24 (RawTouchEnd)
device: 20 (20)
detail: 119
valuators:
0: 12568.00 (0.00)
1: 11399.00 (0.00)

EVENT type 20 (TouchEnd)
device: 20 (20)
detail: 119
flags: emulating
root: 736.41/445.27
event: 671.41/421.27
buttons:
modifiers: locked 0 latched 0 base 0 effective: 0
group: locked 0 latched 0 base 0 effective: 0
valuators:
0: 12568.00
1: 11399.00
    windows: root 0x194 event 0x3c00001 child 0x3c00001

答案1

将 wacom 驱动程序从 0.34.0 升级到 0.39.0,通过构建https://github.com/linuxwacom/xf86-input-wacom解决了这个问题。

相关内容