ACTION-195: updated mousewheel/mousemultiwheel proposal

I basically reworded some things to make it more vague and leave it more  
up to implementors. Hopefully at some point we can pinpoint more what it  
should be.

This e-mail doesn't really help with the "important use case" from Ian,  
but there is ISSUE-84 tracking that.


===
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 number indicating the distance (positive means rotated to  
the right, negative means rotated to the left).

wheelDeltaY is a number indicating the distance (positive means rotated  
away from user or to the right, negative means rotated towards user or to  
the left).

wheelDeltaZ is a number indicating the distance (...).

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.  
Besides that, its default action is to do whatever platform conventions  
suggest for the wheeling behavior.

The <code>mousewheel</code> 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 number  
indicating the distance (positive means rotated away from the user,  
negative means rotated towards the user). The default value of the  
wheelDelta attribute is 0.

XXX: What about UIEvent.detail?

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.)
===


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

Received on Monday, 21 August 2006 15:54:11 UTC