Open Bug 1906974 Opened 4 months ago Updated 4 months ago

Wacom pen eraser reported as button 1 instead of 32 in Pointer event

Categories

(Core :: Widget: Gtk, defect, P3)

Firefox 127
defect

Tracking

()

UNCONFIRMED

People

(Reporter: denilsonsa, Unassigned, NeedInfo)

References

(Blocks 1 open bug)

Details

Steps to reproduce:

  • Firefox nightly 130.0a1 (2024-07-09) (64-bit)
  • Manjaro Linux on x86_64
  • KDE/Plasma with X11
  • [056a:0016] Wacom Co., Ltd CTE-640 [Graphire4 (6x8)] using the default kernel drivers. Possibly reproducible with other tablets, but I don't know because this is the only one I have.

Steps to reproduce:

  1. Open any Pointer events debugging page, such as:
  2. Use the pen tip on the page. It shows buttons=1, as expected.
  3. Use the pen eraser on the page.

Actual results:

Both the pen tip and the pen eraser are reporting the button 1.

Expected results:

According to https://www.w3.org/TR/pointerevents/#the-buttons-property

The pen tip should indeed be the number 1, but the pen eraser should be 32. (Unless I'm misunderstanding the specs.) Alternatively, the tip and the eraser should have different pointerId values.


Also tested on Google Chrome on the same system, and this bug is also present over there.


When I try xinput list, this Wacom tablet gets listed as four input devices:

  • Wacom Graphire4 6x8 Pen stylus
  • Wacom Graphire4 6x8 Pen eraser
  • Wacom Graphire4 6x8 Pen cursor
  • Wacom Graphire4 6x8 Pad pad

When using the Help → Debug → Test Input Devices in MyPaint, I can see that the pen tip and the pen eraser are reported as button=1, but for different devices (either the stylus or the eraser).

The pad device reports button clicks and scroll wheel for the buttons on the tablet itself (i.e. not on the pen).

The cursor device is for an optional accessory that I don't have.

In fact, MyPaint is able to detect the pen tip versus the eraser tip by just hovering them, without even touching. I don't know if the specs even support this use-case. (They should, as painting programs update the selected tool based on what tip is being used.) I'm not sure what should be the best behavior for this use-case, maybe reporting the eraser as a non-primary pointer with a different pointerId. Or maybe asking about it to people responsible for the Pointer Events specs.


Related bug: 1425384 (potentially obsolete)
Blocks: 1631377

Found a related discussion on the W3C GitHub: https://github.com/w3c/pointerevents/issues/134
It seems the behavior for the eraser isn't defined yet. (I mean, besides the button=32, which is less-than-ideal.)

Component: Untriaged → Widget: Gtk
Priority: -- → P3
Product: Firefox → Core

I tested these two websites:

On these systems:

System Hardware Firefox Chrome
Mac OS X Wacom Intuos tablet buggy working
Linux with X11 Wacom Intuos tablet buggy buggy
Windows Microsoft Surface pen working working

Other systems are untested.

  • Buggy behavior means the eraser is still being reported as button 0, and thus indistinguishable from the pen tip.
  • Working behavior means the eraser is being reported as button=5 and buttons=32.

From the linked Chromium/Blink bug report, someone linked to this other discussion that may contain some hints on how to detect the eraser: https://github.com/linux-surface/iptsd/issues/130#issuecomment-1548377769

Flags: needinfo?(stransky)
You need to log in before you can comment on or make changes to this bug.