[webkit-dev] Force Click events
bdakin at apple.com
Fri May 8 14:30:27 PDT 2015
On May 8, 2015, at 2:25 AM, Jonathan Rimmer <jon.rimmer at gmail.com> wrote:
> [I originally posted this to webkit-help, but Benjamin suggested suggested I post here instead]
> Hi all,
> On Twitter, I was bemoaning the lack of communication re. the recently added Force Click events to Benjamin Poulain, and he suggested, probably correctly, that I am out of the loop with respect to WebKit development. There had, he said, been dicussion of this feature on the mailing lists, bugzilla, and the recent contributors meeting.
> This therefore, is my attempt to get in the loop on this issue. I was wondering if anyone could help me find the following:
> Mailing list posts: I have tried searching with the Gmane archive, but have been unable to find any dicussions on this issue. It doesn't help that Gmane does not support phrasal searches, meaning I cannot easily search for "force click", "force touch", "pointer events", etc. Can anyone suggest what words I should search for, or direct me to the relevant threads?
There have not been mailing list posts yet. We have been prototyping some ideas and building demos. When we are ready to email standards groups, we will.
> Contributors meeting: There was apparently a 1 hour discussion at the contributor's meeting that lead to the agreement that the Force Click experiment should be upstreamed. Is there a video or sound recording of this dicussion available? Is there a set of minutes or other summary available? A blog post?
There is not any recording, nor did anyone take minutes. This is typical of the contributor’s meeting.
> Documentation: Benjamin said the feature has been upstreamed to gather feedback. Can anyone point me to developer documentation that would assist in using/testing the feature?
We have not published documentation yet.
I notice you didn’t ask about bugs. There have been lots of those at bugs.webkit.org <http://bugs.webkit.org/> with patches and review comments. Changelog entries are also useful. Let me know if you have trouble finding them.
Brief summary here.
Our current approach adds a new property to all mouse events — force. And we have added 4 new DOM events:
mouseforcewillbegin -> fires before mousedown and allows the web developer to prevent the user agent’s default behavior. (All default behaviors at this time are things that animate between mousedown and forceclick, and they pop open on forceclick, so it is necessary to prevent default even before mousedown in order to prevent any of this from happening.)
mouseforcedown -> fires on the down part of a force click; aligns with the haptic. Like mousedown but for force click instead of click.
mouseforceup -> fires on the up part of a force click; aligns with the haptic. Like mouseup but for force click instead of click.
mouseforcechanged -> fires whenever force changes between mousedown and mouseup. Currently supports a range of values between 0 and 2. Where 0 is mousedown/up, 1 is forcedown/up, and 2 is the maximum force. We are still talking with each other, the community, and working with other teams at Apple to figure out the best way to represent the pressure information, and the range of values is likely to change. We expect this to get a lot of talk in standardization, and we’re open to change. The most accurate representation of what we get from the system is probably a 0-3 range, and we’ll probably switch to that for now unless/until standardization yields other results.
Here’s an illustration of the new events plotted on a fictional graph of a click. The x-axis is time, and the y-axis is force.
> Or something like the Surfin' Safari blog posts that introduced the CSS gradient feature?
That was different. Sure, that was an experimental feature, but it was much further along in prototyping and conceptualizing than this feature is. We have no history of blogging about features at this particular stage of development.
> I am also curious about the decision to develop a non-standard feature instead of implementing Pointer Events? The Point Events spec defines a "pressure" property on pointer events that seems analagous to the "force" property introduced by this feature. Why was a proprietary solution pursued instead of adopting the W3C standard? What does the Force Click events offer that Pointer Events do not?
> Also, how does the development of this feature relate to the WebKit project's stated goal of standards compliance? . Is there a plan to standardise this events with the W3C? Is it wise to name this feature after a marketing term used by a single contributor organisation? Is it intended that these features will be interopable with pressure-sensitive hardware other than Apple's Force Touch trackpad?
Ted O'Connor is working on a standards proposal. So yes, the development of this feature does align with WebKit's goal of standards compliance.
>  https://www.webkit.org/blog/175/introducing-css-gradients/
>  https://www.webkit.org/projects/goals.html
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
-------------- next part --------------
An HTML attachment was scrubbed...
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 125580 bytes
Desc: not available
More information about the webkit-dev