Function

animateMoveTo

Move the trackpad from the current positionTrackpadInjectionScope.currentPosition to the given position, sending a stream of move events to get an animated path of durationMillis milliseconds.

animateMoveTo

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

animateMoveTo

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

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.

Last updated: