Function

smoothScroll

Rotate the mouse's scrollWheel by the given scrollAmount.

smoothScroll

Source set: Common
fun MouseInjectionScope.smoothScroll(
    scrollAmount: Float,
    durationMillis: Long = DefaultMouseGestureDurationMillis,
    scrollWheel: ScrollWheel = ScrollWheel.Vertical,
)

Rotate the mouse's scrollWheel by the given scrollAmount. The total scroll delta is linearly smoothed out over a stream of scroll events between each scroll event.

Positive scrollAmount values correspond to scrolling forward (new content appears at the bottom of a column, or at the end of a row), negative values correspond to scrolling backward (new content appears at the top of a column, or at the start of a row).

Example of a horizontal smooth scroll:

Parameters

scrollAmount The total delta to scroll the scrollWheel by
durationMillis The duration of the gesture. By default 300 milliseconds.
scrollWheel Which scroll wheel will be rotated. By default ScrollWheel.Vertical.

Last updated: