smoothScroll

Function

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

scrollAmountThe total delta to scroll the scrollWheel by
durationMillisThe duration of the gesture. By default 300 milliseconds.
scrollWheelWhich scroll wheel will be rotated. By default ScrollWheel.Vertical.