Re: some notes on wheel events

On Wed, 21 Jun 2006 21:04:50 +0200, Bjoern Hoehrmann <derhoermi@gmx.net>  
wrote:
> I am not sure UIEvent.detail makes sense like that, I thought we wanted
> to avoid http://en.wikipedia.org/wiki/Straferunning style problems, so
> if you "wheel" top-right, you get both wheelDeltaX and wheelDeltaY, and
> UIEvent.detail can't be as specified above if that is indeed the case.

Interesting article. UIEvent.detail must now be 0 for mousemultiwheel (we  
really need a better name...).


>> XXX: i18n?
>> XXX: wheelDeltaY -> wheelDelta?
>> XXX: Array for "any" number of wheels.
>> XXX: MouseEvent.relatedNode?
>
> relatedNode should probably be the node that is beeing "wheel'd" over.
> I am not sure what you mean by "i18n" above. I don't think we need the
> array you mention, and for "wheelDelta" well, that's for the group to
> decide.

i18n is for scrolling from left to right. Should values be switched or  
not. Those type of things.


>> XXX: do we want initMouseWheelEvent() and such?
>
> I think so.

initMouseMultiWheelEvent()... ugh! Added though, see below.


>> Note: Future versions might introduce a mousewheelx and mousewheelz  
>> event given there's a need for them.
>
> There is?

That's the question. (Dropped it therefore.) I now have:


===

When "mouse wheeling" occurs, the implementation must dispatch a  
<code>mousemultiwheel</code> event implementing the following interface:

interface MouseMultiWheelEvent : MouseEvent {
   readonly attribute long            wheelDeltaX;
   readonly attribute long            wheelDeltaY;
   readonly attribute long            wheelDeltaZ;
   void               initMouseMultiWheelEventNS(in DOMString namespaceURI,
                                                 in DOMString typeArg,
                                                 in boolean canBubbleArg,
                                                 in boolean cancelableArg,
                                                 in views::AbstractView  
viewArg,
                                                 in long detailArg,
                                                 in long screenXArg,
                                                 in long screenYArg,
                                                 in long clientXArg,
                                                 in long clientYArg,
                                                 in unsigned short  
buttonArg,
                                                 in EventTarget  
relatedTargetArg,
                                                 in DOMString modifiersList,
                                                 in long wheelDeltaX,
                                                 in long wheelDeltaY,
                                                 in long wheelDeltaZ);
};

wheelDeltaX is a multiple of 120 (positive means rotated to the right,  
negative means rotated to the left).

wheelDeltaY is a multiple of 120 (positive means rotated away from user or  
to the right, negative means rotated towards user or to the left).

wheelDeltaZ is a multiple of 120 (...).

The default value of wheelDeltaX, wheelDeltaY and wheelDeltaZ is 0.  
UIEvent.detail must always be 0.

XXX: wheelDeltaY -> wheelDelta?

This event includes both scroll deltas. The default action of this event  
is to dispatch a <code>mousewheel</code> event if the y delta is non-zero.  
That event implements the following interface:

interface MouseWheelEvent : MouseEvent {
   readonly attribute long            wheelDelta;
   void               initMouseWheelEventNS(in DOMString namespaceURI,
                                            in DOMString typeArg,
                                            in boolean canBubbleArg,
                                            in boolean cancelableArg,
                                            in views::AbstractView viewArg,
                                            in long detailArg,
                                            in long screenXArg,
                                            in long screenYArg,
                                            in long clientXArg,
                                            in long clientYArg,
                                            in unsigned short buttonArg,
                                            in EventTarget relatedTargetArg,
                                            in DOMString modifiersList,
                                            in long wheelDelta);
};

If the <code>mousewheel</code> event is cancelled, only the default action  
for vertical wheeling is cancelled. The wheelDelta attribute is a multiple  
of 120 (positive means rotated away from the user, negative means rotated  
towards the user). UIEvent.detail is wheelDelta divided by 120. The  
default value of the wheelDelta attribute is 0.

For both <code>mousemultiwheel</code> and <code>mousewheel</code>  
<code>MouseEvent.relatedNode</code> must point to the element being  
wheel'd over or <code>null</code> if there is no such element. (For  
example, when using some device without a pointer but with some way to  
wheel you'd get that.)

===

I will e-mail this to the list unless you have some more comments.


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>

Received on Wednesday, 21 June 2006 21:12:49 UTC