HoverPointer.scroll

Current scroll value. For a mouse, this indicates mouse wheel movement, for other devices like touchpad or touchscreen, this will be translated from its movement.

This value indicates the distance and direction in window space that the scroll should result in covering. This means that on the X axis negative values move left and positive values move right, while on the Y axis negative values go upwards and positive values go downwards. For example, a scroll value of (0, 20) scrolls 20 pixels down vertically, while (0, -10) scrolls 10 pixels up.

While it is possible to read scroll of the HoverPointer data received in an input action handler, it is recommended to implement scroll through Scrollable.scrollImpl.

Scroll is exposed for both the horizontal and vertical axis. While a basic mouse wheel only supports vertical movement, touchscreens, touchpads, trackpads or more advanced mouses do support horizontal movement. It is also possible for a device to perform both horizontal and vertical movement at once.

struct HoverPointer
Vector2 scroll;

Meta