WheelEvent.deltaY is only meaningful together with deltaMode, and the
viewer used to read it as if it were always pixels. One physical notch of
the same mouse therefore differed by ~32x between browsers: Chromium and
WebKit report DOM_DELTA_PIXEL with deltaY = 100, Firefox reports
DOM_DELTA_LINE with deltaY = 3. Wheel zoom, Shift+wheel roll and
Ctrl+wheel FOV all consumed that raw number, so on Firefox each moved about
a thirtieth as far per notch — wheel zoom felt essentially dead.
This module converts a wheel event's selected axis delta into a
pixel-mode-equivalent number so every wheel entry point can keep doing the
arithmetic it already does, on a browser-independent input. Most callers
select deltaY; Shift+wheel roll may explicitly fall back to deltaX.
Cross-browser wheel-delta normalization.
WheelEvent.deltaYis only meaningful together withdeltaMode, and the viewer used to read it as if it were always pixels. One physical notch of the same mouse therefore differed by ~32x between browsers: Chromium and WebKit reportDOM_DELTA_PIXELwithdeltaY = 100, Firefox reportsDOM_DELTA_LINEwithdeltaY = 3. Wheel zoom, Shift+wheel roll and Ctrl+wheel FOV all consumed that raw number, so on Firefox each moved about a thirtieth as far per notch — wheel zoom felt essentially dead.This module converts a wheel event's selected axis delta into a pixel-mode-equivalent number so every wheel entry point can keep doing the arithmetic it already does, on a browser-independent input. Most callers select
deltaY; Shift+wheel roll may explicitly fall back todeltaX.