Bug 20458

Summary: Support stylus pressure info in mouse events
Product: WebKit Reporter: Oliver Hunt <oliver>
Component: DOMAssignee: Oliver Hunt <oliver>
Status: RESOLVED WONTFIX    
Severity: Normal CC: annevk, ap, eric.carlson, hyatt, kbr, keishi, mitz, mjs, scottmg
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
URL: http://nerget.com/Scrije/scrije.html
Attachments:
Description Flags
Initial implementation of pressure support none

Oliver Hunt
Reported 2008-08-20 06:19:28 PDT
Styluses commonly provide a variety of data, including pressure, tilt, and rotation. Given almost all tablet/stylus sets now provide pressure information it seems useful to provide it to the dom. This is especially helpful for drawing applications that use the canvas.
Attachments
Initial implementation of pressure support (11.39 KB, patch)
2008-08-20 06:28 PDT, Oliver Hunt
no flags
Oliver Hunt
Comment 1 2008-08-20 06:28:25 PDT
Created attachment 22893 [details] Initial implementation of pressure support This patch provides pressure information in the mouse event. The MouseEvent.pressure property is an double value from 0 to 1, where 0 indicates no pressure, and 1 indicates max pressure. We use a float rather than an integer value as different styluses have different pressure precision, so a float range from 0 to 1 effectively normalises this. A mouse is considered to have binary pressure levels, with pressure of 1 indicating a mouse is down, and pressure 0 indicating no button. I haven't looked into providing tilt info, etc as I am not sure how commonly such information is provided, ditto for rotation information which seems even less common. One other issue is that many styluses provide an "eraser" and it would be nice if we had a mechanism to allow a webpage to identify when the eraser was being used, as this would further increase the fidelity of the browser image processing experience.
mitz
Comment 2 2008-08-20 07:27:22 PDT
See also bug 10598.
Oliver Hunt
Comment 3 2008-09-28 02:05:50 PDT
roc pointed me at the moz tracking bug https://bugzilla.mozilla.org/show_bug.cgi?id=428988 and noted that we should be using vendor prefixes on the pressure property (whoops)
Oliver Hunt
Comment 4 2009-01-02 11:07:26 PST
Okay, I've been looking at the windows mechanisms for getting stylus information. It is worse than the IME APIs. There are multiple halfway there APIs. The most complete is the WinTab API, but afaict that's not actually part of windows, but that's okay because it also doesn't interact with the event queue. It looks like Vista may have some APIs that make this more feasible but on XP there appears to be no such luck. On XP the best we seem to be able to detect is whether an event is from a pen and even that code is unbelievably ugly -- and it only gives us the mouse vs. pen distinction, nothing more. In all honesty I'm leaning towards supporting pressure information on Mac and Gtk, seriously trying to support this on windows seems to be an exercise in futility.
Anne van Kesteren
Comment 5 2024-03-15 04:31:27 PDT
As I understand it this now happens through pointer events.
Note You need to log in before you can comment on or make changes to this bug.