W3C home > Mailing lists > Public > public-webapi@w3.org > May 2006

Fwd: ACTION-169: Mouse wheel events

From: Maciej Stachowiak <mjs@apple.com>
Date: Tue, 2 May 2006 18:02:44 -0700
To: Public Web API <public-webapi@w3.org>
Message-Id: <87C9B9A0-B8E4-42E4-87C1-751B77B8C6F6@apple.com>

Whoops, I meant to send this to the public list, but accidentally  
sent to member:
Begin forwarded message:

> For mouse wheel events, we have two important use cases we want to  
> cover:
>
> 1) Content using the existing nonstandard "mousewheel" event. In  
> this case, it is assumed that the event is for a vertical scroll  
> only, and apparently content depends on the delta not being 0.
>
> 2) Content that wants to handle both vertical and horizontal scroll  
> at once, to avoid "stairstepping". This requires a single event  
> that has access to both scroll deltas and fires when either one is  
> non-zero.
>
> Here is a use case that seems sort of useful but was not seen by  
> the WG as compelling enough to introduce extra design complexity:
>
> 3) Cancel the horizontal scroll only, but not the vertical scroll.
>
>
> Here is a proposed design to handle this.
>
> When mouse wheeling occurs, the implementation dispatches a  
> "mousemultiwheel" event. This event includes both scroll deltas.  
> See stawman proposal for IDL interface below. The default action of  
> the "mousemultiwheel" event is to dispatch a "mousewheel" event if  
> the y delta is non-zero, and then scroll. However, if the  
> "mousewheel" event is cancelled, only the horizontal part of the  
> scrolling is done. This can reasonably address both use cases.  
> Here's an ASCII art diagram of the flow:
>
>
>  [ "mousemultiwheel" ] --------------> [ "mousewheel" ] =====>  
> default scroll
>                       default action
>
>
> This addresses use cases 1 and 2. It does not address use case 3.  
> Use case 3 could be addressed in one of two ways, either add a  
> "mousewheelx" event which is dispatched for non-zero x delta only,  
> or to make wheelDeltaX and wheelDeltaY read-write instead of read- 
> only, with the actual scroll that occurs using the modified value.  
> The WG members present decided not to add either of these  
> complexities.
>
>
> Proposed IDL interface for WheelEvent:
>
> interface WheelEvent : UIEvent {
>   readonly attribute long            screenX;
>   readonly attribute long            screenY;
>   readonly attribute long            clientX;
>   readonly attribute long            clientY;
>   readonly attribute boolean         ctrlKey;
>   readonly attribute boolean         shiftKey;
>   readonly attribute boolean         altKey;
>   readonly attribute boolean         metaKey;
>   readonly attribute long            wheelDelta;
>
>   void               initWheelEvent(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 boolean ctrlKeyArg,
>                                     in boolean altKeyArg,
>                                     in boolean shiftKeyArg,
>                                     in boolean metaKeyArg,
>                                     in long wheelDelta
>                                     );
>   // Introduced in DOM Level 3:
>   boolean            getModifierState(in DOMString keyIdentifierArg);
>   // Introduced in DOM Level 3:
>   void               initMouseEventNS(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 DOMString modifiersList,
>                                       in long wheelDelta);
> };
>
> Proposed IDL interface for MultiWheelEvent (or should it have an  
> array or something to support a general number of wheels?):
>
> interface MultiWheelEvent : UIEvent {
>   readonly attribute long            screenX;
>   readonly attribute long            screenY;
>   readonly attribute long            clientX;
>   readonly attribute long            clientY;
>   readonly attribute boolean         ctrlKey;
>   readonly attribute boolean         shiftKey;
>   readonly attribute boolean         altKey;
>   readonly attribute boolean         metaKey;
>   readonly attribute long            wheelDeltaX;
>   readonly attribute long            wheelDeltaY;
>   readonly attribute long            wheelDeltaZ;
>
>   void               initWheelEvent(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 boolean ctrlKeyArg,
>                                     in boolean altKeyArg,
>                                     in boolean shiftKeyArg,
>                                     in boolean metaKeyArg,
>                                     in long wheelDeltaX,
>                                     in long wheelDeltaY,
>                                     in long wheelDeltaZ
>                                     );
>   // Introduced in DOM Level 3:
>   boolean            getModifierState(in DOMString keyIdentifierArg);
>   // Introduced in DOM Level 3:
>   void               initMouseEventNS(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 DOMString modifiersList,
>                                       in long wheelDeltaX,
>                                       in long wheelDeltaY,
>                                       in long wheelDeltaZ);
> };
>
Received on Wednesday, 3 May 2006 01:03:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:55 GMT