Closed
Bug 879374
Opened 13 years ago
Closed 13 years ago
Tablet pressure for mouse events doesn't work on Mac OS X
Categories
(Core :: Widget: Cocoa, defect)
Tracking
()
RESOLVED
FIXED
mozilla24
People
(Reporter: evanw, Assigned: evanw)
References
Details
(Keywords: dev-doc-needed)
Attachments
(1 file, 1 obsolete file)
|
740 bytes,
patch
|
smichaud
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.29 Safari/537.36
Steps to reproduce:
Open a new tab and type "document.onmousemove = function(e) { console.log(e.mozPressure); };" into the console.
Actual results:
Only 0 is printed to the console, even when the mouse events are generated using a tablet that supports pressure (tested on OS X).
Expected results:
The pressure should be reported as a number between 0 and 1, which should be non-zero when the pen tip is pressed.
| Assignee | ||
Comment 1•13 years ago
|
||
Updated•13 years ago
|
Attachment #758063 -
Flags: review?(smichaud)
Comment 2•13 years ago
|
||
Comment on attachment 758063 [details] [diff] [review]
Patch to add mozPressure support for OS X
Looks fine to me.
Attachment #758063 -
Flags: review?(smichaud) → review+
Updated•13 years ago
|
Assignee: nobody → evan.exe
Status: UNCONFIRMED → ASSIGNED
Component: Untriaged → Widget: Cocoa
Ever confirmed: true
Product: Firefox → Core
Updated•13 years ago
|
Keywords: checkin-needed
Comment 3•13 years ago
|
||
Keywords: checkin-needed
Comment 4•13 years ago
|
||
Comment 5•13 years ago
|
||
Evan:
Probably the best way to fix your patch is to make sure you're not trying to call -[NSEvent pressure] on an event of type NSMouseEntered or NSMouseExited. It's certainly the simplest.
An alternative would be to make sure the event has one of the following types:
NSLeftMouseDown
NSLeftMouseUp
NSRightMouseDown
NSRightMouseUp
NSMouseMoved
NSLeftMouseDragged
NSRightMouseDragged
NSOtherMouseDown
NSOtherMouseUp
NSOtherMouseDragged
But as best I can tell that would be overkill.
Side note:
It's surprising that an NSEvent of subtype NSTabletPointEventSubtype can be generated by our mochitests. Maybe that's a bug in our code that synthesizes native mouse events, or more likely in Apple's +[NSEvent mouseEventWithType:...] method called by it. We may need to initialize that event's subtype to a reasonable value.
I'll try to remember to check up on this later.
| Assignee | ||
Comment 6•13 years ago
|
||
Attachment #758063 -
Attachment is obsolete: true
Attachment #759268 -
Flags: review?(smichaud)
| Assignee | ||
Comment 7•13 years ago
|
||
Thanks for your help! I just finished running the whitelist approach through mochitest and it doesn't cause any issues AFAIK. I don't think NSMouseMoved events make sense with pressure so I haven't included them in the whitelist.
Comment 8•13 years ago
|
||
Comment on attachment 759268 [details] [diff] [review]
Patch to add mozPressure support for OS X
Looks fine to me.
> Thanks for your help!
You're most welcome. And thanks for your patch.
Attachment #759268 -
Flags: review?(smichaud) → review+
Updated•13 years ago
|
Keywords: checkin-needed
Comment 9•13 years ago
|
||
Keywords: checkin-needed
Comment 10•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Updated•13 years ago
|
Keywords: dev-doc-needed
You need to log in
before you can comment on or make changes to this bug.
Description
•