[whatwg] Suggestion: Mouse Wheel events for Web Apps 1.0

Mikko Rantalainen mikko.rantalainen at peda.net
Tue Jun 21 06:45:48 PDT 2005

Erik Arvidsson wrote:
> Chris Griego wrote:
>>Currently the only way to capture and use the mouse wheel on the web
>>is within the Macromedia Flash v7 plugin which added event handling
>>for the mouse wheel.
> That's incorrect. Both IE (since 5.5?) and Mozilla supports this. 
> Unfortunately they do it in different ways.
> [...]
> The values here are bit different.
> In Mozilla, if you have set Mozilla to scroll a certain number of rows 
> you get the number of steps here. If you have it set to scroll one page 
> at a time you get large values and I'm not sure if these represents the 
> number of rows in some way.
> In IE it returns multiples of 120 but I guess it really represent 3 rows 
> * 40 twips/row and that changing this in some control panel applet or in 
> the registry might give you other alternative results.
> The values in IE is negative when Mozilla is positive and the other way 
> around.

To be ready for better pointing devices in the future, I think that 
the mouse delta should be defined for at least two dimensions (x and 
y) and the delta should be accompanied with an unit.

We could define following:

event.wheelDeltaX: float
event.wheelDeltaXUnit: "px" | "char" | "page"
event.wheelDeltaY: float
event.wheelDeltaYUnit: "px" | "char" | "page"

And define that positive values mean that content should be 
positioned inside the viewport so that positive deltas bring content 
to view from bottom and from right.

I assume that in the future, mouse wheels will not have huge 
discrete steps anymore. So moving towards "px" is required. However, 
the "page" setting will be preferred by some and it cannot be 
cleanly emulated with a single "px" value so we need an unit in 
addition. Also, I selected word "char" instead of "row" so that the 
same unit name is usable with both X and Y axis. I'm not sure if 
"char" unit should be included, though - it can be nicely emulated 
with "px".


More information about the whatwg mailing list