Hi Jonas, That’s a good point. I agree with you that we should only expose this to certified or privileged apps.
Thanks and regards, Kershaw 於 2014/9/12 上午1:22,"Jonas Sicking" <jo...@sicking.cc> 寫道: >Hi Kershaw, > >Has there been any discussions with other browser vendors about this >API? Or is there an official standard somewhere for them? > >If not, I don't think that we'll want to expose this to the web at >large. It would still be fine to expose to certified apps, or even to >expose to privileged apps under a permission. > >Does this sound ok? > >/ Jonas > >On Wed, Sep 10, 2014 at 11:18 PM, Kershaw Chang <kech...@mozilla.com> >wrote: >> Hi All, >> >> Summary: >> Touchpad(trackpad) is a common feature on laptop computers. Currently, >>the >> finger activities on touchpad are translated to touch event and mouse >>event. >> However, the coordinates of touch event and mouse event are actually >> associated to display [1]. For some cases, we need to expose the >>absolute >> coordinates that are associated to touchpad itself to the application. >> That's why AOSP also defines another input source type for touchpad >>[2]. The >> x and y coordinates of touchpad event are relative to the size of >>touchpad. >> >> Use case: >> Handwriting recognition application will be benefited from this touchpad >> event. Currently, OS X supports handwriting input by touchpad [3]. >> >> Idea of implementation: >> The webidl of touchpad event is like touch event except that x and y >> coordinates are relative to touchpad rather than display. >> >> --- /dev/null >> +++ b/dom/webidl/Touchpad.webidl >> + >> +[Func="mozilla::dom::Touchpad::PrefEnabled"] >> +interface Touchpad { >> + readonly attribute long identifier; >> + readonly attribute EventTarget? target; >> + readonly attribute long touchpadX; >> + readonly attribute long touchpadY; >> + readonly attribute long radiusX; >> + readonly attribute long radiusY; >> + readonly attribute float rotationAngle; >> + readonly attribute float force; >> +}; >> >> --- /dev/null >> +++ b/dom/webidl/TouchpadEvent.webidl >> + >> +interface WindowProxy; >> + >> +[Func="mozilla::dom::TouchpadEvent::PrefEnabled"] >> +interface TouchPadEvent : UIEvent { >> + readonly attribute TouchpadList touches; >> + readonly attribute TouchpadList targetTouches; >> + readonly attribute TouchpadList changedTouches; >> + >> + readonly attribute short button; >> + readonly attribute boolean altKey; >> + readonly attribute boolean metaKey; >> + readonly attribute boolean ctrlKey; >> + readonly attribute boolean shiftKey; >> + >> + [Throws] >> + void initTouchpadEvent(DOMString type, >> + boolean canBubble, >> + boolean cancelable, >> + WindowProxy? view, >> + long detail, >> + short button, >> + boolean ctrlKey, >> + boolean altKey, >> + boolean shiftKey, >> + boolean metaKey, >> + TouchPadList? touches, >> + TouchPadList? targetTouches, >> + TouchPadList? changedTouches); >> +}; >> >> --- /dev/null >> +++ b/dom/webidl/TouchpadList.webidl >> + >> +[Func="mozilla::dom::TouchpadList::PrefEnabled"] >> +interface TouchpadList { >> + [Pure] >> + readonly attribute unsigned long length; >> + getter Touchpad? item(unsigned long index); >> +}; >> + >> +/* Mozilla extension. */ >> +partial interface TouchpadList { >> + Touchpad? identifiedTouch(long identifier); >> +}; >> >> Platform converge: all >> >> Welcome for any suggestion or feedback. >> Thanks. >> >> [1] >> >>http://developer.android.com/reference/android/view/InputDevice.html#SOUR >>CE_ >> CLASS_POINTER >> [2] >> >>http://developer.android.com/reference/android/view/InputDevice.html#SOUR >>CE_ >> CLASS_POSITION >> [3] http://support.apple.com/kb/HT4288 >> >> Best regards, >> Kershaw >> >> >> _______________________________________________ >> dev-webapi mailing list >> dev-web...@lists.mozilla.org >> https://lists.mozilla.org/listinfo/dev-webapi _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform