[Pointer Events] Firefox macOS + Wacom stylus tiltY is inverted
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
People
(Reporter: redux, Assigned: akisakurai)
References
(Blocks 1 open bug)
Details
Attachments
(6 files)
Steps to reproduce:
- using a Wacom Intuos Pro tablet, go to https://patrickhlauke.github.io/touch/pen-tracker/index.html
- move the pen over the digitizer, tilt it towards you, then away from you
Actual results:
the tiltY value is inverted - when the pen's "back end" (eraser tip) is tilted towards the user, tiltY is reporting negative values, and when the pen is tilted away from the user, it's reporting positive tiltY values
Expected results:
per the spec https://w3c.github.io/pointerevents/#dom-pointerevent-tilty when the pen is tilted towards the user, tiltY has positive values, and negative values when pointing away from the user
running the Wacom diagnostic tool, which reports the sensor data, it can be seen that this is the case ... but Firefox seems to then flip the sign for the value.
running the same page in Chrome/macOS, the values reported there for tiltY are correct. testing on Firefox/Windows shows that there tiltY is also reported correctly, so this seems a macOS-specific problem.
Reporter | ||
Comment 1•2 years ago
|
||
Reporter | ||
Comment 2•2 years ago
|
||
Reporter | ||
Comment 3•2 years ago
|
||
Reporter | ||
Comment 4•2 years ago
|
||
the above three images show what happens when tilting the pen away from the user. both the wacom diagnostic tool and chrome (purple UI) show negative tiltY values. firefox, on the other hand, shows a positive tiltY value. (the specific values aren't exactly the same, as my hand moved in between screenshots, but in all three cases, the pen was tilted with its end away from me)
Reporter | ||
Comment 5•2 years ago
|
||
Reporter | ||
Comment 6•2 years ago
|
||
Reporter | ||
Comment 7•2 years ago
|
||
added two actual photos showing both the pen tracker (and its reported values) and my actual hand with the stylus (quite unnaturally) tilted away from me - compare the negative tiltY and correct visualisation of the pen in the case of Chrome, and the inverted way it reports/appears on Firefox
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 8•1 year ago
|
||
As a semi-related bug, Firefox is reporting tiltX=1
and tiltY=1
for a Wacom pen that doesn't support tilt. Yes, I should report this as a separate bug (and I'll probably do it later), but I'm mentioning it here because whoever decides to fix this tiltY axis could also take a look at the surrounding code.
For hardware and platforms that do not report tilt, the value MUST be 0. https://www.w3.org/TR/pointerevents/#pointerevent-interface
For whoever decides to investigate this bug, I believe the relevant code is in two files:
- https://hg.mozilla.org/mozilla-unified/file/tip/widget/MouseEvents.h
- https://hg.mozilla.org/mozilla-unified/file/tip/widget/gtk/nsWindow.cpp
If anyone is interested, this seems to be the related Chromium source-code: https://source.chromium.org/chromium/chromium/src/+/main:ui/events/x/events_x_utils.cc It seems to get the data directly from X11 events, while Firefox reads from GDK events. I couldn't test the tiltY on any of the browsers, as my tablet doesn't support it. (Likewise, I can't test the Twist.)
Comment 9•1 year ago
|
||
(In reply to Denilson Figueiredo de Sá from comment #8)
- https://hg.mozilla.org/mozilla-unified/file/tip/widget/MouseEvents.h
- https://hg.mozilla.org/mozilla-unified/file/tip/widget/gtk/nsWindow.cpp
If anyone is interested, this seems to be the related Chromium source-code: https://source.chromium.org/chromium/chromium/src/+/main:ui/events/x/events_x_utils.cc It seems to get the data directly from X11 events, while Firefox reads from GDK events. I couldn't test the tiltY on any of the browsers, as my tablet doesn't support it. (Likewise, I can't test the Twist.)
I guess this bug is about MacOS but you reference Linux code here.
Comment 10•1 year ago
|
||
Oops, sorry! My mistake! Sorry for the noise.
Assignee | ||
Comment 11•7 months ago
|
||
- Negate tilt.y in Cocoa pen handling to correct inverted Y tilt
- See https://github.com/qt/qtbase/blob/0f128fd7c5a9ee721d1e631743f6eb61d927cf3b/src/plugins/platforms/cocoa/qnsview_tablet.mm#L63
- See https://source.chromium.org/chromium/chromium/src/+/main:components/input/web_input_event_builders_mac.mm;drc=0af5ffa1e4cc4cc4f818725f8fee93ec57855e4b;l=421
Updated•7 months ago
|
Description
•