Trust Flex Graphics Tablet incorrect button mapping with Linux 4.17, detected as mouse with Linux 4.18 so no Pen input device, no pressure detection, etc.
Hello!
After installation libinput 1.11.1 with applied udev quirk https://github.com/systemd/systemd/pull/9395 I find that with Linux 4.17 stylus buttons is mapped incorrectly. According to documentation (available at https://www.trust.com/en/product/21259-flex-design-tablet-black and http://trust.com/21259 ) small button should be mapped as Right Mouse Button, big button should be mapped as Middle Mouse Button. With Linux 4.17 small button is detected as BTN_EXTRA, and big button is detect as BTN_FORWARD, which result in apps such as Krita not detect this buttons.
dmesg with Linux 4.17:
[ 53.056094] usb 3-2: new full-speed USB device number 2 using xhci_hcd
[ 53.208160] usb 3-2: New USB device found, idVendor=2179, idProduct=0004, bcdDevice= 0.00
[ 53.208169] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 53.208175] usb 3-2: Product: TABLET WP5540
[ 53.208180] usb 3-2: Manufacturer: UGTABLET
[ 53.219653] input: UGTABLET TABLET WP5540 as /devices/pci0000:00/0000:00:1c.0/0000:01:00.0/0000:02:02.0/0000:37:00.0/usb3/3-2/3-2:1.0/0003:2179:0004.0008/input/input24
[ 53.277433] hid-generic 0003:2179:0004.0008: input,hiddev2,hidraw2: USB HID v1.00 Mouse [UGTABLET TABLET WP5540] on usb-0000:37:00.0-2/input0
Xorg log with Linux 4.17:
[ 54.687] (II) config/udev: Adding input device UGTABLET TABLET WP5540 (/dev/input/mouse3)
[ 54.688] (II) No input driver specified, ignoring this device.
[ 54.688] (II) This device may have been added with another device file.
[ 54.880] (II) config/udev: Adding input device UGTABLET TABLET WP5540 (/dev/input/event19)
[ 54.880] (**) UGTABLET TABLET WP5540: Applying InputClass "libinput pointer catchall"
[ 54.880] (**) UGTABLET TABLET WP5540: Applying InputClass "libinput tablet catchall"
[ 54.880] (II) Using input driver 'libinput' for 'UGTABLET TABLET WP5540'
[ 54.941] (II) systemd-logind: got fd for /dev/input/event19 13:83 fd 59 paused 0
[ 54.942] (**) UGTABLET TABLET WP5540: always reports core events
[ 54.942] (**) Option "Device" "/dev/input/event19"
[ 54.942] (**) Option "_source" "server/udev"
[ 54.944] (II) event19 - UGTABLET TABLET WP5540: is tagged by udev as: Mouse Tablet
[ 54.977] (II) event19 - UGTABLET TABLET WP5540: tablet 'UGTABLET TABLET WP5540' unknown to libwacom
[ 54.977] (II) event19 - UGTABLET TABLET WP5540: device is a tablet
[ 54.977] (II) event19 - UGTABLET TABLET WP5540: device removed
[ 54.977] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/0000:02:02.0/0000:37:00.0/usb3/3-2/3-2:1.0/0003:2179:0004.0008/input/input24/event19"
[ 54.977] (II) XINPUT: Adding extended input device "UGTABLET TABLET WP5540" (type: TABLET, id 19)
[ 54.982] (II) event19 - UGTABLET TABLET WP5540: is tagged by udev as: Mouse Tablet
[ 55.008] (II) event19 - UGTABLET TABLET WP5540: tablet 'UGTABLET TABLET WP5540' unknown to libwacom
[ 55.008] (II) event19 - UGTABLET TABLET WP5540: device is a tablet
xinput properties with Linux 4.17:
Device 'UGTABLET TABLET WP5540 Pen (0)':
Device Enabled (142): 1
Coordinate Transformation Matrix (144): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Device Node (268): "/dev/input/event19"
Device Product ID (269): 8569, 4
libinput Tablet Tool Pressurecurve (562): 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000, 1.000000
libinput Tablet Tool Area Ratio (563): 0, 0
With Linux 4.18 there seems like some breakage, as tablet is no longer detected as tablet, but as mouse instead. So there is incorrect resolution (10x10cm according to coordinates from libinput-debug-event output) no pressure detection and no Pen input device. However, with Linux 4.18 buttons is mapped correctly, as BTN_RIGHT and BTN_MIDDLE.
dmesg with Linux 4.18:
[ 91.489370] usb 3-2: new full-speed USB device number 2 using xhci_hcd
[ 91.641801] usb 3-2: New USB device found, idVendor=2179, idProduct=0004, bcdDevice= 0.00
[ 91.641810] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 91.641817] usb 3-2: Product: TABLET WP5540
[ 91.641823] usb 3-2: Manufacturer: UGTABLET
[ 91.653441] input: UGTABLET TABLET WP5540 as /devices/pci0000:00/0000:00:1c.0/0000:01:00.0/0000:02:02.0/0000:37:00.0/usb3/3-2/3-2:1.0/0003:2179:0004.0008/input/input32
[ 91.713581] input: UGTABLET TABLET WP5540 Mouse as /devices/pci0000:00/0000:00:1c.0/0000:01:00.0/0000:02:02.0/0000:37:00.0/usb3/3-2/3-2:1.0/0003:2179:0004.0008/input/input33
[ 91.715229] input: UGTABLET TABLET WP5540 Mouse as /devices/pci0000:00/0000:00:1c.0/0000:01:00.0/0000:02:02.0/0000:37:00.0/usb3/3-2/3-2:1.0/0003:2179:0004.0008/input/input34
[ 91.716583] hid-generic 0003:2179:0004.0008: input,hiddev2,hidraw2: USB HID v1.00 Mouse [UGTABLET TABLET WP5540] on usb-0000:37:00.0-2/input0
Xorg log with Linux 4.18:
[ 92.860] (II) config/udev: Adding input device UGTABLET TABLET WP5540 Mouse (/dev/input/mouse5)
[ 92.861] (II) No input driver specified, ignoring this device.
[ 92.861] (II) This device may have been added with another device file.
[ 92.877] (II) config/udev: Adding input device UGTABLET TABLET WP5540 Mouse (/dev/input/mouse4)
[ 92.877] (II) No input driver specified, ignoring this device.
[ 92.877] (II) This device may have been added with another device file.
[ 92.889] (II) config/udev: Adding input device UGTABLET TABLET WP5540 (/dev/input/mouse1)
[ 92.889] (II) No input driver specified, ignoring this device.
[ 92.889] (II) This device may have been added with another device file.
[ 93.029] (II) config/udev: Adding input device UGTABLET TABLET WP5540 (/dev/input/event7)
[ 93.029] (**) UGTABLET TABLET WP5540: Applying InputClass "libinput tablet catchall"
[ 93.030] (II) Using input driver 'libinput' for 'UGTABLET TABLET WP5540'
[ 93.094] (II) systemd-logind: got fd for /dev/input/event7 13:71 fd 60 paused 0
[ 93.094] (**) UGTABLET TABLET WP5540: always reports core events
[ 93.094] (**) Option "Device" "/dev/input/event7"
[ 93.094] (**) Option "_source" "server/udev"
[ 93.104] (II) event7 - UGTABLET TABLET WP5540: is tagged by udev as: Tablet
[ 93.155] (II) event7 - UGTABLET TABLET WP5540: tablet 'UGTABLET TABLET WP5540' unknown to libwacom
[ 93.168] (II) event7 - UGTABLET TABLET WP5540: device is a tablet
[ 93.169] (II) event7 - UGTABLET TABLET WP5540: device removed
[ 93.170] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/0000:02:02.0/0000:37:00.0/usb3/3-2/3-2:1.0/0003:2179:0004.0008/input/input32/event7"
[ 93.171] (II) XINPUT: Adding extended input device "UGTABLET TABLET WP5540" (type: TABLET, id 19)
[ 93.180] (II) event7 - UGTABLET TABLET WP5540: is tagged by udev as: Tablet
[ 93.276] (II) event7 - UGTABLET TABLET WP5540: tablet 'UGTABLET TABLET WP5540' unknown to libwacom
[ 93.277] (II) event7 - UGTABLET TABLET WP5540: device is a tablet
[ 93.296] (II) config/udev: Adding input device UGTABLET TABLET WP5540 Mouse (/dev/input/event8)
[ 93.297] (**) UGTABLET TABLET WP5540 Mouse: Applying InputClass "libinput pointer catchall"
[ 93.300] (II) Using input driver 'libinput' for 'UGTABLET TABLET WP5540 Mouse'
[ 93.304] (II) systemd-logind: got fd for /dev/input/event8 13:72 fd 62 paused 0
[ 93.304] (**) UGTABLET TABLET WP5540 Mouse: always reports core events
[ 93.304] (**) Option "Device" "/dev/input/event8"
[ 93.305] (**) Option "_source" "server/udev"
[ 93.317] (II) event8 - UGTABLET TABLET WP5540 Mouse: is tagged by udev as: Mouse
[ 93.318] (II) event8 - UGTABLET TABLET WP5540 Mouse: device is a pointer
[ 93.319] (II) event8 - UGTABLET TABLET WP5540 Mouse: device removed
[ 93.319] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/0000:02:02.0/0000:37:00.0/usb3/3-2/3-2:1.0/0003:2179:0004.0008/input/input33/event8"
[ 93.321] (II) XINPUT: Adding extended input device "UGTABLET TABLET WP5540 Mouse" (type: MOUSE, id 20)
[ 93.330] (**) Option "AccelerationScheme" "none"
[ 93.340] (**) UGTABLET TABLET WP5540 Mouse: (accel) selected scheme none/0
[ 93.340] (**) UGTABLET TABLET WP5540 Mouse: (accel) acceleration factor: 2.000
[ 93.341] (**) UGTABLET TABLET WP5540 Mouse: (accel) acceleration threshold: 4
[ 93.352] (II) event8 - UGTABLET TABLET WP5540 Mouse: is tagged by udev as: Mouse
[ 93.353] (II) event8 - UGTABLET TABLET WP5540 Mouse: device is a pointer
[ 93.361] (II) config/udev: Adding input device UGTABLET TABLET WP5540 Mouse (/dev/input/event15)
[ 93.362] (**) UGTABLET TABLET WP5540 Mouse: Applying InputClass "libinput pointer catchall"
[ 93.362] (II) Using input driver 'libinput' for 'UGTABLET TABLET WP5540 Mouse'
[ 93.365] (II) systemd-logind: got fd for /dev/input/event15 13:79 fd 63 paused 0
[ 93.365] (**) UGTABLET TABLET WP5540 Mouse: always reports core events
[ 93.365] (**) Option "Device" "/dev/input/event15"
[ 93.365] (**) Option "_source" "server/udev"
[ 93.381] (II) event15 - UGTABLET TABLET WP5540 Mouse: is tagged by udev as: Mouse
[ 93.381] (II) event15 - UGTABLET TABLET WP5540 Mouse: device is a pointer
[ 93.381] (II) event15 - UGTABLET TABLET WP5540 Mouse: device removed
[ 93.381] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/0000:02:02.0/0000:37:00.0/usb3/3-2/3-2:1.0/0003:2179:0004.0008/input/input34/event15"
[ 93.381] (II) XINPUT: Adding extended input device "UGTABLET TABLET WP5540 Mouse" (type: MOUSE, id 21)
[ 93.383] (**) Option "AccelerationScheme" "none"
[ 93.383] (**) UGTABLET TABLET WP5540 Mouse: (accel) selected scheme none/0
[ 93.383] (**) UGTABLET TABLET WP5540 Mouse: (accel) acceleration factor: 2.000
[ 93.383] (**) UGTABLET TABLET WP5540 Mouse: (accel) acceleration threshold: 4
[ 93.384] (II) event15 - UGTABLET TABLET WP5540 Mouse: is tagged by udev as: Mouse
[ 93.384] (II) event15 - UGTABLET TABLET WP5540 Mouse: device is a pointer
xinput properties with Linux 4.18
Device 'UGTABLET TABLET WP5540':
Device Enabled (142): 1
Coordinate Transformation Matrix (144): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Device Node (268): "/dev/input/event7"
Device Product ID (269): 8569, 4
Device 'UGTABLET TABLET WP5540 Mouse':
Device Enabled (142): 1
Coordinate Transformation Matrix (144): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Natural Scrolling Enabled (288): 0
libinput Natural Scrolling Enabled Default (289): 0
libinput Scroll Methods Available (292): 0, 0, 1
libinput Scroll Method Enabled (293): 0, 0, 0
libinput Scroll Method Enabled Default (294): 0, 0, 0
libinput Button Scrolling Button (548): 2
libinput Button Scrolling Button Default (549): 2
libinput Middle Emulation Enabled (298): 0
libinput Middle Emulation Enabled Default (299): 0
libinput Accel Speed (300): 0.000000
libinput Accel Speed Default (301): 0.000000
libinput Accel Profiles Available (550): 1, 1
libinput Accel Profile Enabled (551): 1, 0
libinput Accel Profile Enabled Default (552): 1, 0
libinput Left Handed Enabled (302): 0
libinput Left Handed Enabled Default (303): 0
libinput Send Events Modes Available (265): 1, 0
libinput Send Events Mode Enabled (266): 0, 0
libinput Send Events Mode Enabled Default (267): 0, 0
Device Node (268): "/dev/input/event8"
Device Product ID (269): 8569, 4
libinput Drag Lock Buttons (304): <no items>
libinput Horizontal Scroll Enabled (305): 1
Device 'UGTABLET TABLET WP5540 Mouse':
Device Enabled (142): 1
Coordinate Transformation Matrix (144): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Natural Scrolling Enabled (288): 0
libinput Natural Scrolling Enabled Default (289): 0
libinput Middle Emulation Enabled (298): 0
libinput Middle Emulation Enabled Default (299): 0
libinput Calibration Matrix (553): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Calibration Matrix Default (554): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Left Handed Enabled (302): 0
libinput Left Handed Enabled Default (303): 0
libinput Send Events Modes Available (265): 1, 0
libinput Send Events Mode Enabled (266): 0, 0
libinput Send Events Mode Enabled Default (267): 0, 0
Device Node (268): "/dev/input/event15"
Device Product ID (269): 8569, 4
libinput Drag Lock Buttons (304): <no items>
libinput Horizontal Scroll Enabled (305): 1
libinput-debug-events with Linux 4.18:
-event8 DEVICE_ADDED UGTABLET TABLET WP5540 Mouse seat0 default group14 cap:p left scroll-nat scroll-button
-event7 DEVICE_ADDED UGTABLET TABLET WP5540 seat0 default group14 cap:T size 94x49mm
-event15 DEVICE_ADDED UGTABLET TABLET WP5540 Mouse seat0 default group14 cap:p size 140x100mm left scroll-nat calib
...
event15 POINTER_MOTION_ABSOLUTE +3.66s 100.00/ 99.82
event15 POINTER_MOTION_ABSOLUTE +3.67s 100.00/100.00
event15 POINTER_BUTTON +3.76s BTN_LEFT (272) released, seat count: 0
So I assume with Linux 4.18 some additional quirk is necessary to get detection as tablet back? In libinput or in udev? What about buttons mapping?