Function

animateMoveTo

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.

animateMoveTo

Source set: Common
public 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

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

animateMoveTo

Source set: Common
public fun TrackpadInjectionScope.animateMoveTo(
    position: Offset,
    durationMillis: Long = DefaultTrackpadGestureDurationMillis,
)

Move the trackpad from the current position to the given position, sending a stream of move events to get an animated path of durationMillis milliseconds. Move the trackpad 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 trackpad along a line:

Parameters

position The position where to move the trackpad to, in the node's local coordinate system
durationMillis The duration of the gesture. By default, 300 milliseconds.
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: