natiny.input.get_wheel_y

Lua
natiny.input.get_wheel_y() -> notches

Returns the accumulated vertical wheel movement since the last frame, in notches. Every wheel event reported between frames contributes to the result. One detent of an ordinary mouse is 1; a trackpad sends many smaller numbers. The value is independent of the window's scale mode and uses the same unit on the desktop and in a browser. Positive is away from the user.

Returns

Type Description
number Notches turned this frame; 0 when it did not

Example

Lua
-- scroll a list, three lines to a notch
offset = offset - natiny.input.get_wheel_y() * 3

Notes

  • A finger on a touch screen does not turn the wheel. Read get_touch_y_speed for that.