On 2014-09-11, 5:54 PM, smaug wrote:
> If we just needs new coordinates, couldn't we extend the existing event
> interfaces with some new properties?
Yeah, this seems like the way to go to me as well.
> On 09/12/2014 12:52 AM, smaug wrote:
>> What would be the event types for touchpad events?
>> We must not add yet another types of events to handle pointer type of events.
>>
>>
>> And besides, touch event model is rather horrible, so if we for some strange
>> reason need
>> totally new events, I'd prefer using something closer to pointer events.
>>
>>
>> -Olli
>>
>>
>>
>>
>> On 09/11/2014 09:18 AM, Kershaw Chang 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#SOURCE_
>>> CLASS_POINTER
>>> [2]
>>> http://developer.android.com/reference/android/view/InputDevice.html#SOURCE_
>>> CLASS_POSITION
>>> [3] http://support.apple.com/kb/HT4288
>>>
>>> Best regards,
>>> Kershaw
>>>
>>>
>>
>
> _______________________________________________
> dev-platform mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-platform
>
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform