Linebender graphics wiki
  • Linebender graphics wiki
  • Gamma
  • Color spaces
  • Drawing coordinate system
  • Immediate mode
  • Mouse wheel
  • Useful links
Powered by GitBook
On this page
  • Web
  • Windows
  • macOS
  • External mouse wheel vs trackpad

Was this helpful?

Mouse wheel

PreviousImmediate modeNextUseful links

Last updated 1 month ago

Was this helpful?

This wiki is now archived. You should instead visit the at

What does scrolling actually mean? It depends on the platform and on the mouse.

See for the code that implements this. There are some additional links and comments in the review.

Web

specifies it as the “expected amount the page will scroll”

On my Windows machine, “away from user” is a negative number. At lines = 3 (in preferences), one bump of the physical mouse wheel is 200. Rightward motion on the trackpad is a positive number.

On my Mac, when “Scroll direction: Natural” is checked, “away from user” is a positive number, and rightward motion on the trackpad is a negative number. Both flip when it is unchecked. The magnitude is dependent on the rate of scrolling (i.e. this is adaptively scaled).

See significant discussion in , including having got the polarity wrong.

Windows

specifies that rolling away from the user is a positive number. Rightward motion on the trackpad is a positive number.

One bump of the external scroll wheel is 120, consistent with documentation.

The sensitivity setting should be read from SystemParametersInfo.

macOS

is not helpful.

The value of scrollingDeltaX and scrollingDeltaY is the negative of the web value. Note also, hasPreciseScrollingDeltas is true for trackpad and false for external mice.

The value of scrollingDeltaX and scrollingDeltaY inverts when the “Scroll direction: Natural” setting is toggled, i.e .the setting is applied before the event is given to the app.

External mouse wheel vs trackpad

An external mouse wheel delta is traditionally multiplied by 32, while a touchpad delta is not. Here's the . Also note that (using LineDelta for an ext mouse wheel, PixelDelta for the trackpad).

This wiki is now archived. You should instead visit the at

Linebender wiki
https://linebender.org/wiki
druid#68
W3C's WheelEvent
Chromium issue 227454
The doc for WM_MOUSEWHEEL message
The doc for NSEvent scrollingDeltaY
corresponding Makepad version
Winit keeps the distinction
Linebender wiki
https://linebender.org/wiki