Skip to content

wacom: Prefer the stylus over the eraser

Pens with an integrated eraser share the serial number with the corresponding pen but differ in the tool ID. libwacom provides a "paired_id" mapping to look up one from the other.

If the user brings the eraser into proximity the very first time the tool is seen, the eraser's tool ID is stored in the keyfile instead of the associated stylus id. This leads to otherwise wrong behavior since erasers share the serial number with the stylus but don't have any buttons, don't have any erasers themselves, etc.

Fix this by looking up a matching stylus when we see an eraser. This effectively filters our CcWacomTool to always be the pen, which is an inadvertent assumption anyway.

cc @carlosg since this reverts his 9bd0b945 and maybe there's something I missed.

Merge request reports