animateMoveTo

Function

Common
fun MouseInjectionScope.animateMoveTo(
    position: Offset,
    durationMillis: Long = DefaultMouseGestureDurationMillis,
)

Move the mouse from the current position to the given position, sending a stream of move events to get an animated path of durationMillis milliseconds. Move the mouse to the desired start position if you want to start from a different position. The position is 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 line:

Parameters

positionThe position where to move the mouse to, in the node's local coordinate system
durationMillisThe duration of the gesture. By default 300 milliseconds.