$ xinput --list
So we see that xinput --list points its manpage to talk about wayland, which has a section saying...
I found these links, but can't remember how.
https://wayland.freedesktop.org/libinput/doc/latest/tablet-support.html
https://forum.manjaro.org/t/support-for-pressure-sensitive-tablets-in-wayland/90469/2
https://lists.freedesktop.org/archives/wayland-devel/2014-June/015605.html
https://www.reddit.com/r/ObsidianMD/comments/1hbx3qi/fix_for_pressure_sensitivity_not_working_on/
Installing libinput-tools gives access to a cli tool that prints debug stuff, but does not reflect any additional configuration done by a compositor or desktop environment. (warning, source for this is deepseek LLM)
The following showed a fullscreen popup with a debug visualization showing pressure support.
$ libinput debug-gui
$ sudo libinput debug-gui
This prints an updating TUI tracking tablet data.
$ libinput debug-tablet
When not pressing
$ groups
$ libinput list-devices
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | Device: Power Button
Kernel: /dev/input/event2
Id: host:0000:0001
Group: 1
Seat: seat0, default
Capabilities: keyboard
Tap-to-click: n/a
Tap-and-drag: n/a
Tap button map: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Scroll button: n/a
Scroll button lock: n/a
Click methods: none
Clickfinger button map: n/a
Disable-w-typing: n/a
Disable-w-trackpointing: n/a
Accel profiles: n/a
Rotation: 0.0
Area rectangle: n/a
Device: Power Button
Kernel: /dev/input/event0
Id: host:0000:0001
Group: 2
Seat: seat0, default
Capabilities: keyboard
Tap-to-click: n/a
Tap-and-drag: n/a
Tap button map: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Scroll button: n/a
Scroll button lock: n/a
Click methods: none
Clickfinger button map: n/a
Disable-w-typing: n/a
Disable-w-trackpointing: n/a
Accel profiles: n/a
Rotation: 0.0
Area rectangle: n/a
Device: Lid Switch
Kernel: /dev/input/event1
Id: host:0000:0005
Group: 3
Seat: seat0, default
Capabilities: switch
Tap-to-click: n/a
Tap-and-drag: n/a
Tap button map: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Scroll button: n/a
Scroll button lock: n/a
Click methods: none
Clickfinger button map: n/a
Disable-w-typing: n/a
Disable-w-trackpointing: n/a
Accel profiles: n/a
Rotation: 0.0
Area rectangle: n/a
Device: DP-1
Kernel: /dev/input/event21
Id: <unknown>:0000:0000
Group: 4
Seat: seat0, default
Capabilities: keyboard pointer
Tap-to-click: n/a
Tap-and-drag: n/a
Tap button map: n/a
Tap drag lock: n/a
Left-handed: disabled
Nat.scrolling: disabled
Middle emulation: n/a
Calibration: n/a
Scroll methods: *button
Scroll button: KEY_RESERVED
Scroll button lock: disabled
Click methods: none
Clickfinger button map: n/a
Disable-w-typing: n/a
Disable-w-trackpointing: n/a
Accel profiles: flat *adaptive custom
Rotation: n/a
Area rectangle: n/a
Device: Razer Razer DeathAdder V3 Pro Keyboard
Kernel: /dev/input/event24
Id: usb:1532:00b6
Group: 5
Seat: seat0, default
Capabilities: keyboard pointer
Tap-to-click: n/a
Tap-and-drag: n/a
Tap button map: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: disabled
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Scroll button: n/a
Scroll button lock: n/a
Click methods: none
Clickfinger button map: n/a
Disable-w-typing: n/a
Disable-w-trackpointing: n/a
Accel profiles: n/a
Rotation: 0.0
Area rectangle: n/a
Device: Razer Razer DeathAdder V3 Pro
Kernel: /dev/input/event26
Id: usb:1532:00b6
Group: 5
Seat: seat0, default
Capabilities: keyboard
Tap-to-click: n/a
Tap-and-drag: n/a
Tap button map: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Scroll button: n/a
Scroll button lock: n/a
Click methods: none
Clickfinger button map: n/a
Disable-w-typing: n/a
Disable-w-trackpointing: n/a
Accel profiles: n/a
Rotation: 0.0
Area rectangle: n/a
Device: ZSA Technology Labs Ergodox EZ Keyboard
Kernel: /dev/input/event27
Id: usb:3297:4976
Group: 6
Seat: seat0, default
Capabilities: keyboard pointer
Tap-to-click: n/a
Tap-and-drag: n/a
Tap button map: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: disabled
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Scroll button: n/a
Scroll button lock: n/a
Click methods: none
Clickfinger button map: n/a
Disable-w-typing: n/a
Disable-w-trackpointing: n/a
Accel profiles: n/a
Rotation: 0.0
Area rectangle: n/a
Device: Valve Software Steam Controller
Kernel: /dev/input/event5
Id: usb:28de:1205
Group: 7
Seat: seat0, default
Capabilities: pointer
Tap-to-click: n/a
Tap-and-drag: n/a
Tap button map: n/a
Tap drag lock: n/a
Left-handed: disabled
Nat.scrolling: disabled
Middle emulation: n/a
Calibration: n/a
Scroll methods: button
Scroll button: BTN_RIGHT
Scroll button lock: disabled
Click methods: none
Clickfinger button map: n/a
Disable-w-typing: n/a
Disable-w-trackpointing: n/a
Accel profiles: flat *adaptive custom
Rotation: 0.0
Area rectangle: n/a
Device: Valve Software Steam Controller
Kernel: /dev/input/event6
Id: usb:28de:1205
Group: 7
Seat: seat0, default
Capabilities: keyboard
Tap-to-click: n/a
Tap-and-drag: n/a
Tap button map: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Scroll button: n/a
Scroll button lock: n/a
Click methods: none
Clickfinger button map: n/a
Disable-w-typing: n/a
Disable-w-trackpointing: n/a
Accel profiles: n/a
Rotation: 0.0
Area rectangle: n/a
Device: AT Translated Set 2 keyboard
Kernel: /dev/input/event3
Id: serial:0001:0001
Group: 8
Seat: seat0, default
Capabilities: keyboard
Tap-to-click: n/a
Tap-and-drag: n/a
Tap button map: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Scroll button: n/a
Scroll button lock: n/a
Click methods: none
Clickfinger button map: n/a
Disable-w-typing: n/a
Disable-w-trackpointing: n/a
Accel profiles: n/a
Rotation: 0.0
Area rectangle: n/a
Device: Huion keyboard
Kernel: /dev/input/event17
Id: usb:256c:ffff
Group: 9
Seat: seat0, default
Capabilities: keyboard
Tap-to-click: n/a
Tap-and-drag: n/a
Tap button map: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Scroll button: n/a
Scroll button lock: n/a
Click methods: none
Clickfinger button map: n/a
Disable-w-typing: n/a
Disable-w-trackpointing: n/a
Accel profiles: n/a
Rotation: 0.0
Area rectangle: n/a
Device: HUION 256C PEN STYLUS
Kernel: /dev/input/event7
Id: usb:256c:eeed
Group: 10
Seat: seat0, default
Size: 8x5mm
Capabilities: tablet
Tap-to-click: n/a
Tap-and-drag: n/a
Tap button map: n/a
Tap drag lock: n/a
Left-handed: disabled
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: identity matrix
Scroll methods: none
Scroll button: n/a
Scroll button lock: n/a
Click methods: none
Clickfinger button map: n/a
Disable-w-typing: n/a
Disable-w-trackpointing: n/a
Accel profiles: none
Rotation: n/a
Area rectangle: (0.00, 0.00) - (1.00, 1.00)
|
I asked deepseek if using libinput was the correct approach for a painting app. It explained that x11 consumes libinput devices via the xf86-input-libinput driver, and that they are thus exposed over the x11 protocol, not via libinput.
It went on to talk about how you would have to write an abstraction layer that handled both cases, and recommended using gtk, qt, or similar, where such wrapping has already been done. It pointed towards https://wayland.app/protocols/tablet-v2.
I was confused, and asked a follow up question. Deepseek replied that libinput is the driver that talks to the hardware, and zwp_tablet_v2 is how applications then talk to this hardware. I checked that OurPaint is running inside of XWayland by running XEyes and observing that the eyes move when I hover over the OurPaint window (the eyes do not move when hovering over wayland native applications.)
I asked Deepseek:
"The application in question uses its own custom windowing and UI framework. It seems to be running inside XWayland when launched in a wayland environment. The pressure support is not working for my tablet, which shows pressure information inside of libinput-tools. The question I wish to solve is how to expose that information to the x native application in a way it understands."
I tried to clone and build the source, but the my CMake binary is too new, so support for CMake < 3.5 has been removed:
Passing that, I see I am missing lagui.
I clone, run cmake passing that -D flag, and run make.
I go back to OurPaint, and try again.
At this point I give up trying to build because I am not experienced with C, but I find the logic for pressure in la_kernel.c, where the strings are compared.
I go back to xinput to see which devices show my tablet input.
I try with xinput test 2 and get an error, and xinput test 12, 13, and 14 don't work. So only the "stylus" shows data with xinput test 11.
When testing the stylus, many lines are printed like below
a[2] is the pressure. a[3] is x tilt, -64 (pen looks like --> ) to 63 (pen looks like <-- ). a[4] is y tilt, -64 (pen looks like v) to 63 (pen looks like ^).