PointerEvent.button still remains to be -1 for pointerdown for pens on Gtk backend
Categories
(Core :: Widget: Gtk, defect)
Tracking
()
People
(Reporter: saschanaz, Unassigned)
References
(Blocks 1 open bug)
Details
My repro steps:
- Attach Wacom CTL-460 on Steam Deck
- Open https://patrickhlauke.github.io/touch/tracker/multi-touch-tracker-pointer-hud.html
- Check
button
value for pointerdown.
Expected: 0
Actual: -1
Updated•8 months ago
|
Comment 1•7 months ago
|
||
I don't think it's a bug. That test page reacts not just to pointerdown
, but also to pointerover
, pointermove
, pointerup
, pointerout
, pointercancel
.
This other page is a better testcase, as this one only reacts to pointerdown
: https://output.jsbin.com/rawusar/4
The .button
property is only valid for events triggered by pressing or releasing such button:
This property only guarantees to indicate which buttons are pressed during events caused by pressing or releasing one or multiple buttons. As such, it is not reliable for events such as
mouseenter
,mouseleave
,mouseover
,mouseout
, ormousemove
.
For all other events, look at .buttons
property, which is a bitmask showing the currently pressed buttons.
Reporter | ||
Comment 2•7 months ago
|
||
It's strongly recommended to refer to the spec instead of MDN for implementation bugs: https://w3c.github.io/pointerevents/#the-button-property
Comment 3•7 months ago
|
||
Indeed, I should have linked to the official specs. They say:
the button property indicates the device button whose state change fired the event
In other words, when there is a button state change (pressed or released) and that change caused a certain event, then for this event the .button
property has a value. But, if there is pointermove
event, it was caused by the movement of the device and not due to any button, and thus the .button
property will be zero.
Assuming I understood all of this correctly, Firefox seems to be working correctly.
On the Nightly version, on the page I linked, .button
is indeed 0
, as expected. (Nightly is needed due to recent fixes on Pointer events. Bug 1606832) Tested on a Wacom tablet connected to a Steam Deck.
Can you please confirm if this is still a bug for you? Please remember to launch Firefox with MOZ_USE_XINPUT2=1
. (Bug 1207700)
Reporter | ||
Comment 4•7 months ago
|
||
Ah, you're right, somehow I thought pointermoves should set the button property too (and I should have set the title properly for that). Then this bug is invalid with my false expectation. Sorry for the confusion/noise and thanks for the thoughtful clarification!
Description
•