Function

animateMoveAlong

Move the trackpad along the given [curve], sending a stream of move events to get an animated path of [durationMillis] milliseconds.

animateMoveAlong

Common
fun TrackpadInjectionScope.animateMoveAlong(
    curve: (timeMillis: Long) -> Offset,
    durationMillis: Long = DefaultTrackpadGestureDurationMillis,
)

Move the trackpad along the given curve, sending a stream of move events to get an animated path of durationMillis milliseconds. The trackpad will initially be moved to the start of the path, curve(0), if it is not already there. The positions defined by the curve are in the node's local coordinate system, where (0, 0) is the top left corner of the node.

Example of moving the trackpad along a curve:

Parameters

curve The function that defines the position of the trackpad over time for this gesture, in the node's local coordinate system. The argument passed to the function is the time in milliseconds since the start of the animated move, and the return value is the location of the trackpad at that point in time
durationMillis The duration of the gesture. By default 300 milliseconds.

animateMoveAlong

Common
fun MouseInjectionScope.animateMoveAlong(
    curve: (timeMillis: Long) -> Offset,
    durationMillis: Long = DefaultMouseGestureDurationMillis,
)

Move the mouse along the given curve, sending a stream of move events to get an animated path of durationMillis milliseconds. The mouse will initially be moved to the start of the path, curve(0), if it is not already there. The positions defined by the curve are in the node's local coordinate system, where (0, 0) is the top left corner of the node.

Example of moving the mouse along a curve:

Parameters

curve The function that defines the position of the mouse over time for this gesture, in the node's local coordinate system. The argument passed to the function is the time in milliseconds since the start of the animated move, and the return value is the location of the mouse at that point in time
durationMillis The duration of the gesture. By default 300 milliseconds.