Huion 420 tablet reports erroneous BTN_STYLUS2 events on tip + BTN_STYLUS down
Hi,
I'm running libinput 1.15.3 with a Huion 420 tablet, whose pen has two buttons.
If the pen is in proximity, but not down, pressing the lowest button reports (in libinput debug-events
) BTN_STYLUS pressed
, and pressing the upper button reports BTN_STYLUS2 pressed
. If the pen is down and BTN_STYLUS2
is pressed, everything works as expected. Things break down when BTN_STYLUS
is pressed while the tip is down.
The first issue is that it gets reported as a BTN_STYLUS2
press rather than a BTN_STYLUS
press, and it seems to cause a tool tip up event just prior to the press itself. A snippet of the libinput debug-events
:
event13 TABLET_TOOL_PROXIMITY +471.055s 36.34*/26.95* pressure: 0.00* pen (0, id 0) proximity-in axes:p btn:SS2
# I pressed BTN_STYLUS here
event13 TABLET_TOOL_TIP +471.571s 37.75/23.78* pressure: 0.01* down
# I did *not* lift the pen here
event13 TABLET_TOOL_TIP +471.967s 37.95/23.73 pressure: 0.00* up
event13 TABLET_TOOL_BUTTON +471.975s 332 (BTN_STYLUS2) pressed, seat count: 1
# I released BTN_STYLUS here
event13 TABLET_TOOL_BUTTON +472.427s 332 (BTN_STYLUS2) released, seat count: 0
# Tool tip was down the entire time, but is reported as down again here
event13 TABLET_TOOL_TIP +472.431s 38.00/23.04* pressure: 0.87* down
The second, likely related issue is that during the time the tip is down and the button is pressed, if the pen is moved around, a number of pressed
/released
events are generated despite firmly holding the button down.
event13 TABLET_TOOL_BUTTON +646.157s 332 (BTN_STYLUS2) pressed, seat count: 1
event13 TABLET_TOOL_BUTTON +646.185s 332 (BTN_STYLUS2) released, seat count: 0
event13 TABLET_TOOL_BUTTON +646.209s 332 (BTN_STYLUS2) pressed, seat count: 1
event13 TABLET_TOOL_BUTTON +646.213s 332 (BTN_STYLUS2) released, seat count: 0
event13 TABLET_TOOL_BUTTON +646.229s 332 (BTN_STYLUS2) pressed, seat count: 1
event13 TABLET_TOOL_BUTTON +646.233s 332 (BTN_STYLUS2) released, seat count: 0
event13 TABLET_TOOL_BUTTON +646.285s 332 (BTN_STYLUS2) pressed, seat count: 1
event13 TABLET_TOOL_BUTTON +646.621s 332 (BTN_STYLUS2) released, seat count: 0
...
Reproducing the above steps with BTN_STYLUS2
shows no weird behaviour: the tip is consistently reported as being down, and there's no pressed/released toggling happening. However, this makes BTN_STYLUS
unusable on tip down, since it somehow gets mapped to a misbehaving BTN_STYLUS2
.
Looking at raw evdev output from evemu-record
tells a similar story; BTN_STYLUS2
events are being received rather than BTN_STYLUS
, and BTN_TOUCH
toggling is seen there too.
I'm happy to provide any other info that might be useful here.