Skip to content

bpf: add Wacom Art Pen pressure filter

Benjamin Tissoires requested to merge bentiss/udev-hid-bpf:wip/art-pen into main

This filter is here for the Art Pen stylus only:

  • when used on some Wacom devices (see the list of attached PIDs), this pen reports pressure every other events.
  • to solve that, given that we know that the next event will be the same as the current one, we can emulate a smoother pressure reporting by reporting the mean of the previous value and the current one.

We are effectively delaying the pressure by one event every other event, but that's a little annoyance compared to the not smoothness of the reported data.

For example, let's assume the following set of events:

<Tip switch 0> <X 0> <Y 0> <Pressure    0 > <Tooltype 0x0804>
<Tip switch 1> <X 1> <Y 1> <Pressure  100 > <Tooltype 0x0804>
<Tip switch 1> <X 2> <Y 2> <Pressure  100 > <Tooltype 0x0804>
<Tip switch 1> <X 3> <Y 3> <Pressure  200 > <Tooltype 0x0804>
<Tip switch 1> <X 4> <Y 4> <Pressure  200 > <Tooltype 0x0804>
<Tip switch 0> <X 5> <Y 5> <Pressure    0 > <Tooltype 0x0804>

The filter will report:

<Tip switch 0> <X 0> <Y 0> <Pressure    0 > <Tooltype 0x0804>
<Tip switch 1> <X 1> <Y 1> <Pressure * 50*> <Tooltype 0x0804>
<Tip switch 1> <X 2> <Y 2> <Pressure  100 > <Tooltype 0x0804>
<Tip switch 1> <X 3> <Y 3> <Pressure *150*> <Tooltype 0x0804>
<Tip switch 1> <X 4> <Y 4> <Pressure  200 > <Tooltype 0x0804>
<Tip switch 0> <X 5> <Y 5> <Pressure    0 > <Tooltype 0x0804>

See also libinput/libinput#973 (closed)

Edited by Peter Hutterer

Merge request reports