---
title: "animateMoveBy"
description: "Move the trackpad from the [current position][TrackpadInjectionScope.currentPosition] by the
given [delta], sending a stream of move events to get an animated path of [durationMillis]
milliseconds."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun TrackpadInjectionScope.animateMoveBy(
    delta: Offset,
    durationMillis: Long = DefaultTrackpadGestureDurationMillis,
)
```


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

#### Parameters

| | |
| --- | --- |
| delta | The position where to move the trackpad to, relative to the current position of the trackpad. For example, `delta = Offset(100.px, -100.px) will move the trackpad 100 pixels to the right and 100 pixels upwards. |
| durationMillis | The duration of the gesture. By default 300 milliseconds. |




<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun MouseInjectionScope.animateMoveBy(
    delta: Offset,
    durationMillis: Long = DefaultMouseGestureDurationMillis,
)
```


Move the mouse from the `current position` by the given
`delta`, sending a stream of move events to get an animated path of `durationMillis`
milliseconds.

#### Parameters

| | |
| --- | --- |
| delta | The position where to move the mouse to, relative to the current position of the mouse. For example, `delta = Offset(100.px, -100.px) will move the mouse 100 pixels to the right and 100 pixels upwards. |
| durationMillis | The duration of the gesture. By default 300 milliseconds. |




