[dojo-contributors] Should we be normalizing mouseWheel scroll event?

Mark Hays haysmark at us.ibm.com
Fri Oct 22 12:50:55 EDT 2010


You can't normalize events to +/- 1 because 1) the browser collapses mouse 
events and adds the wheelDeltas together and 2) the wheelDelta is a 
function of the OS's user-specified mouse wheel delta.

> Karl Tiedt <ktiedt at gmail.com> 
> Sent by: dojo-contributors-bounces at mail.dojotoolkit.org
> 
> 10/22/2010 12:14 PM
> 
> Please respond to
> "dojo dev." <dojo-contributors at mail.dojotoolkit.org>
> 
> To
> 
> "dojo dev." <dojo-contributors at mail.dojotoolkit.org>
> 
> cc
> 
> Subject
> 
> Re: [dojo-contributors] Should we be normalizing mouseWheel scroll 
event?
> 
> Looking for some input here while I attempt to fix this....
> From the bug text, here are the values reported
> 
> Event type value[[BR]]
>    - firefox : evt.type : DOMMouseScroll
>    - ie, safari, opera : evt.type : mousewheel
> 
> Wheel values (browser : property name : wheel values on wheel motion
> up/down)[[BR]]
> ON windows
>     - safari, opera, ie : evt.wheelDelta : +/- 120
>     - firefox, opera : evt.detail : -/+ 3
> 
> ON mac
>     - safari : evt.wheelDelta : +/- 120
>     - opera : evt.wheelDelta : +/- 40
>     - firefox, opera : evt.detail : -/+ 1
> 
> Position of cursor during mouse wheel[[BR]]
>     - ie, safari, opera : evt.pageX/Y
>     - firefox : evt.screenX/Y
> 
> Per the spec, wheelDelta == correct, however values are not spec'd...
> would normalizing down to a flat +/- 1suffice for wheelDelta?
> also screenX/Y are easy... at least assuming screenX = pageX is
> sufficient, however apparently I suck at Opera and cant get its
> console to actually act like a console and log stuff for me to see...
> so if someone has a 'dummys guide to opera dragonfly' I'd appreciate
> it, the opera dev page was useless
> 
> Note: this would involve patching some widgets that reply on scrolling
> (_Spinner.js for example) but... normalized is still better right?
> 
> -Karl Tiedt
> 
> 
> 
> On Thu, Oct 21, 2010 at 16:32, Scott J. Miles <sjmiles at dojotoolkit.org> 
wrote:
> > This has been languishing for years here:
> >
> > http://trac.dojotoolkit.org/ticket/3763
> >
> > If you can fix that up by transferring the code from Spinner, that 
would be
> > outstanding.
> >
> > Scott
> >
> > On 10/21/2010 2:15 PM, Karl Tiedt wrote:
> >>
> >> It seems we make no effort to normalize scrollwheel events yet we
> >> clearly know how to translate them (_Spinner.js in dijit/form/) does
> >> anyways...
> >>
> >> Before opening a bug figure I would get input or see if there was a
> >> good reason we did not...
> >>
> >>        var scrollAmount = evt.detail ? (evt.detail * -1) : 
(evt.wheelDelta
> >> /
> >> 120);<--- detail is Mozilla, wheelData is everything else (IE, Opera,
> >> Webkit)
> >>
> >>
> >>
> >> -Karl Tiedt
> >> _______________________________________________
> >> dojo-contributors mailing list
> >> dojo-contributors at mail.dojotoolkit.org
> >> http://mail.dojotoolkit.org/mailman/listinfo/dojo-contributors
> >
> >
> _______________________________________________
> dojo-contributors mailing list
> dojo-contributors at mail.dojotoolkit.org
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-contributors
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-contributors/attachments/20101022/23a94014/attachment.htm 


More information about the dojo-contributors mailing list