# TrackpadInjectionScope

Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/TrackpadInjectionScope.kt+class:androidx.compose.ui.test.TrackpadInjectionScope) Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0) Common/AllAndroid/JVM
- Cmn

  ```
  interface TrackpadInjectionScope : InjectionScope
  ```

*** ** * ** ***

The receiver scope of the trackpad input injection lambda from `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.SemanticsNodeInteraction).performTrackpadInput(kotlin.Function1)`.

The functions in `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope` can roughly be divided into two groups: full gestures and individual trackpad events. The individual trackpad events are: `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#press(androidx.compose.ui.test.TrackpadButton)`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#moveTo(androidx.compose.ui.geometry.Offset,kotlin.Long)` and friends, `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#release(androidx.compose.ui.test.TrackpadButton)`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#cancel(kotlin.Long)`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).pan(androidx.compose.ui.geometry.Offset)` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#advanceEventTime(kotlin.Long)`. Full gestures are all the other functions, like `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).click(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).doubleClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).animateMoveTo(androidx.compose.ui.geometry.Offset,kotlin.Long)`, etc. These are built on top of the individual events and serve as a good example on how you can build your own full gesture functions.

A trackpad move event can be sent with `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#moveTo(androidx.compose.ui.geometry.Offset,kotlin.Long)` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#moveBy(androidx.compose.ui.geometry.Offset,kotlin.Long)`. The trackpad position can be updated with `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#updatePointerTo(androidx.compose.ui.geometry.Offset)` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#updatePointerBy(androidx.compose.ui.geometry.Offset)`, which will not send an event and only update the position internally. This can be useful if you want to send an event that is not a move event with a location other than the current location, but without sending a preceding move event. Use `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#press(androidx.compose.ui.test.TrackpadButton)` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#release(androidx.compose.ui.test.TrackpadButton)` to send button pressed and button released events. This will also send all other necessary events that keep the stream of trackpad events consistent with actual trackpad input, such as a hover exit event. A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#cancel(kotlin.Long)` event can be sent at any time when at least one button is pressed. Use `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).pan(androidx.compose.ui.geometry.Offset)` to send a trackpad pan event.

The entire event injection state is shared between all `perform.*Input` methods, meaning you can continue an unfinished trackpad gesture in a subsequent invocation of `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.SemanticsNodeInteraction).performTrackpadInput(kotlin.Function1)` or `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.SemanticsNodeInteraction).performMultiModalInput(kotlin.Function1)`. Note however that while the trackpad's position is retained across invocation of `perform.*Input` methods, it is always manipulated in the current node's local coordinate system. That means that two subsequent invocations of `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.SemanticsNodeInteraction).performTrackpadInput(kotlin.Function1)` on different nodes will report a different `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#currentPosition()`, even though it is actually the same position on the screen.

All events sent by these methods are batched together and sent as a whole after `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.SemanticsNodeInteraction).performTrackpadInput(kotlin.Function1)` has executed its code block.

Example of performing a trackpad click:

```kotlin
import androidx.compose.ui.test.click
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.performTrackpadInput

composeTestRule.onNodeWithTag("myComponent").performTrackpadInput {
    // Click in the middle of the node
    click(center)
}
```

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope` |   |

## Summary

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#cancel(kotlin.Long)(delayMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sends a cancel event `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#cancel(kotlin.Long)` after the last sent event to cancel a stream of trackpad events with pressed buttons. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#enter(androidx.compose.ui.geometry.Offset,kotlin.Long)(position: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset, delayMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sends a hover enter event at the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#enter(androidx.compose.ui.geometry.Offset,kotlin.Long)`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#enter(androidx.compose.ui.geometry.Offset,kotlin.Long)` after the last sent event, without sending a hover move event. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#exit(androidx.compose.ui.geometry.Offset,kotlin.Long)(position: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset, delayMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sends a hover exit event at the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#exit(androidx.compose.ui.geometry.Offset,kotlin.Long)`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#exit(androidx.compose.ui.geometry.Offset,kotlin.Long)` after the last sent event, without sending a hover move event. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#moveBy(androidx.compose.ui.geometry.Offset,kotlin.Long)(delta: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset, delayMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sends a move event `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#moveBy(androidx.compose.ui.geometry.Offset,kotlin.Long)` after the last sent event on the associated node, with the position of the trackpad moved by the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#moveBy(androidx.compose.ui.geometry.Offset,kotlin.Long)`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#moveTo(androidx.compose.ui.geometry.Offset,kotlin.Long)(position: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset, delayMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sends a move event `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#moveTo(androidx.compose.ui.geometry.Offset,kotlin.Long)` after the last sent event on the associated node, with the position of the trackpad updated to `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#moveTo(androidx.compose.ui.geometry.Offset,kotlin.Long)`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#panEnd(kotlin.Long)(delayMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Ends a pan gesture. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#panMoveBy(androidx.compose.ui.geometry.Offset,kotlin.Long)(delta: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset, delayMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Updates the ongoing pan gesture, by applying the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#panMoveBy(androidx.compose.ui.geometry.Offset,kotlin.Long)` as part of the pan. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#panStart()()` Starts a pan gesture. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#press(androidx.compose.ui.test.TrackpadButton)(button: https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton)` Sends a down and button pressed event for the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#press(androidx.compose.ui.test.TrackpadButton)` on the associated node. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#release(androidx.compose.ui.test.TrackpadButton)(button: https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton)` Sends a button released and up event for the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#release(androidx.compose.ui.test.TrackpadButton)` on the associated node. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#scaleChangeBy(kotlin.Float,kotlin.Long)( scaleFactor: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, fromInclusive = false) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, delayMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html )` Updates the ongoing scale gesture, by applying the given multiplicative `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#scaleChangeBy(kotlin.Float,kotlin.Long)` as part of the gesture. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#scaleEnd(kotlin.Long)(delayMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Ends a scale gesture. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#scaleStart()()` Starts a scale gesture. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#updatePointerBy(androidx.compose.ui.geometry.Offset)(delta: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset)` Updates the position of the trackpad by the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#updatePointerBy(androidx.compose.ui.geometry.Offset)`, but does not send a move or hover event. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#updatePointerTo(androidx.compose.ui.geometry.Offset)(position: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset)` Updates the position of the trackpad to the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#updatePointerTo(androidx.compose.ui.geometry.Offset)`, but does not send a move or hover event. | Cmn |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#currentPosition()` Returns the current position of the cursor. | Cmn |

| ### Extension functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#(androidx.compose.ui.test.TrackpadInjectionScope).animateMoveAlong(kotlin.Function1,kotlin.Long)( curve: (timeMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) -> https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset, durationMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html )` Move the trackpad along the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).animateMoveAlong(kotlin.Function1,kotlin.Long)`, sending a stream of move events to get an animated path of `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).animateMoveAlong(kotlin.Function1,kotlin.Long)` milliseconds. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#(androidx.compose.ui.test.TrackpadInjectionScope).animateMoveBy(androidx.compose.ui.geometry.Offset,kotlin.Long)( delta: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset, durationMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html )` Move the trackpad from the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#currentPosition()` by the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).animateMoveBy(androidx.compose.ui.geometry.Offset,kotlin.Long)`, sending a stream of move events to get an animated path of `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).animateMoveBy(androidx.compose.ui.geometry.Offset,kotlin.Long)` milliseconds. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#(androidx.compose.ui.test.TrackpadInjectionScope).animateMoveTo(androidx.compose.ui.geometry.Offset,kotlin.Long)( position: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset, durationMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html )` Move the trackpad from the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#currentPosition()` to the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).animateMoveTo(androidx.compose.ui.geometry.Offset,kotlin.Long)`, sending a stream of move events to get an animated path of `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).animateMoveTo(androidx.compose.ui.geometry.Offset,kotlin.Long)` milliseconds. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#(androidx.compose.ui.test.TrackpadInjectionScope).click(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)(position: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset, button: https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton)` Use `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).click(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` to click on `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).click(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)`, or on the current cursor position if `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).click(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` is `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset#Unspecified()`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#(androidx.compose.ui.test.TrackpadInjectionScope).doubleClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)( position: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset, button: https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton )` Use `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).doubleClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` to double-click on `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).doubleClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)`, or on the current trackpad position if `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).doubleClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` is `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset#Unspecified()`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#(androidx.compose.ui.test.TrackpadInjectionScope).dragAndDrop(androidx.compose.ui.geometry.Offset,androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton,kotlin.Long)( start: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset, end: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset, button: https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton, durationMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html )` Use `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).dragAndDrop(androidx.compose.ui.geometry.Offset,androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton,kotlin.Long)` to drag and drop something from `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).dragAndDrop(androidx.compose.ui.geometry.Offset,androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton,kotlin.Long)` to `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).dragAndDrop(androidx.compose.ui.geometry.Offset,androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton,kotlin.Long)` in `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).dragAndDrop(androidx.compose.ui.geometry.Offset,androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton,kotlin.Long)` milliseconds. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#(androidx.compose.ui.test.TrackpadInjectionScope).longClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)( position: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset, button: https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton )` Use `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).longClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` to long-click on `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).longClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)`, or on the current trackpad position if `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).longClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` is `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset#Unspecified()`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#(androidx.compose.ui.test.TrackpadInjectionScope).pan(androidx.compose.ui.geometry.Offset)(offset: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset)` Sends a pan gesture with the given total `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).pan(androidx.compose.ui.geometry.Offset)`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#(androidx.compose.ui.test.TrackpadInjectionScope).pan(kotlin.Function1,kotlin.Long,kotlin.collections.List)( curve: (timeMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) -> https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset, durationMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, keyTimes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html> )` Sends a pan gesture with the offsets in the panning coordinate space following the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).pan(kotlin.Function1,kotlin.Long,kotlin.collections.List)`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#(androidx.compose.ui.test.TrackpadInjectionScope).panWithVelocity(androidx.compose.ui.geometry.Offset,kotlin.Float,kotlin.Long)( offset: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset, endVelocity: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, durationMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html )` Performs a pan gesture on the associated node such that it ends with the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).panWithVelocity(androidx.compose.ui.geometry.Offset,kotlin.Float,kotlin.Long)`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#(androidx.compose.ui.test.TrackpadInjectionScope).rightClick(androidx.compose.ui.geometry.Offset)(position: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset)` Secondary-click on `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).rightClick(androidx.compose.ui.geometry.Offset)`, or on the current cursor position if `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).rightClick(androidx.compose.ui.geometry.Offset)` is `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset#Unspecified()`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#(androidx.compose.ui.test.TrackpadInjectionScope).scale(kotlin.Float)( scaleFactor: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, fromInclusive = false) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` Sends a scale event with the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).scale(kotlin.Float)`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope.https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#(androidx.compose.ui.test.TrackpadInjectionScope).tripleClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)( position: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset, button: https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton )` Use `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).tripleClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` to triple-click on `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).tripleClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)`, or on the current trackpad position if `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).tripleClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` is `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset#Unspecified()`. | Cmn |

### Inherited functions

From [androidx.compose.ui.unit.Density](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density) `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(androidx.compose.ui.unit.Dp).roundToPx()()`

Convert `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` to `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` by rounding
Cmn `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(androidx.compose.ui.unit.TextUnit).roundToPx()()`

Convert Sp to `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` by rounding
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(kotlin.Int).toDp()()`

Convert an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` pixel value to `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp`.
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(kotlin.Float).toDp()()`

Convert a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` pixel value to a Dp
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize` `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(androidx.compose.ui.geometry.Size).toDpSize()()`

Convert a `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size` to a `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize`.
Cmn `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(androidx.compose.ui.unit.Dp).toPx()()`

Convert `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` to pixels.
Cmn `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(androidx.compose.ui.unit.TextUnit).toPx()()`

Convert Sp to pixels.
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpRect.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(androidx.compose.ui.unit.DpRect).toRect()()`

Convert a `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpRect` to a `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect`.
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(androidx.compose.ui.unit.DpSize).toSize()()`

Convert a `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize` to a `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size`.
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(kotlin.Int).toSp()()`

Convert an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` pixel value to Sp.
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(kotlin.Float).toSp()()`

Convert a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` pixel value to a Sp
Cmn From [androidx.compose.ui.unit.FontScaling](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/FontScaling) `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/FontScaling#(androidx.compose.ui.unit.TextUnit).toDp()()`

Convert Sp to `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp`.
Cmn `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/FontScaling#(androidx.compose.ui.unit.Dp).toSp()()`

Convert `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` to Sp.
Cmn From [androidx.compose.ui.test.InjectionScope](https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#advanceEventTime(kotlin.Long)(durationMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`

Adds the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#advanceEventTime(kotlin.Long)` to the current event time, delaying the next event by that time.
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#percentOffset(kotlin.Float,kotlin.Float)(x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`

Creates an `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` relative to the size of the node we're interacting with.
Cmn

### Inherited properties

From [androidx.compose.ui.unit.Density](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#density()`

The logical density of the display.
Cmn From [androidx.compose.ui.unit.FontScaling](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/FontScaling) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/FontScaling#fontScale()`

Current user preference for the scaling factor for fonts.
Cmn From [androidx.compose.ui.test.InjectionScope](https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope) `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#bottom()`

The y-coordinate for the bottom of the node we're interacting with in px, in the node's local coordinate system, where (0, 0) is the top left corner of the node.
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#bottomCenter()`

The center of the bottom edge of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#bottomLeft()`

The bottom left corner of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#bottomRight()`

The bottom right corner of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#center()`

The center of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#centerLeft()`

The center of the left edge of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#centerRight()`

The center of the right edge of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.
Cmn `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#centerX()`

The x-coordinate for the center of the node we're interacting with in px, in the node's local coordinate system, where (0, 0) is the top left corner of the node.
Cmn `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#centerY()`

The y-coordinate for the center of the node we're interacting with in px, in the node's local coordinate system, where (0, 0) is the top left corner of the node.
Cmn `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#eventPeriodMillis()`

The default time between two successive events.
Cmn `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#height()`

The height of the node in px.
Cmn `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#left()`

The x-coordinate for the left edge of the node we're interacting with in px, in the node's local coordinate system, where (0, 0) is the top left corner of the node.
Cmn `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#right()`

The x-coordinate for the right edge of the node we're interacting with in px, in the node's local coordinate system, where (0, 0) is the top left corner of the node.
Cmn `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#top()`

The y-coordinate for the top of the node we're interacting with in px, in the node's local coordinate system, where (0, 0) is the top left corner of the node.
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#topCenter()`

The center of the top edge of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#topLeft()`

The top left corner of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.
Cmn `open https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#topRight()`

The top right corner of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.
Cmn `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/ViewConfiguration` `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#viewConfiguration()`

The `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/ViewConfiguration` in use by the `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/SemanticsNode` from the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/SemanticsNodeInteraction` on which the input injection method is called.
Cmn `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize` `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#visibleSize()`

The size of the visible part of the node we're interacting with in px, i.e. its clipped bounds.
Cmn `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#width()`

The width of the node in px.
Cmn

## Public functions

### cancel

Cmn Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

```
fun cancel(delayMillis: Long = eventPeriodMillis): Unit
```

Sends a cancel event `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#cancel(kotlin.Long)` after the last sent event to cancel a stream of trackpad events with pressed buttons. All buttons will be released as a result. A trackpad cancel event can only be sent when buttons are pressed.

| Parameters |
|---|---|
| `delayMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html = eventPeriodMillis` | The time between the last sent event and this event. `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#eventPeriodMillis()` by default. |

### enter

Cmn Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

```
fun enter(
    position: Offset = currentPosition,
    delayMillis: Long = eventPeriodMillis
): Unit
```

Sends a hover enter event at the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#enter(androidx.compose.ui.geometry.Offset,kotlin.Long)`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#enter(androidx.compose.ui.geometry.Offset,kotlin.Long)` after the last sent event, without sending a hover move event.

The `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#enter(androidx.compose.ui.geometry.Offset,kotlin.Long)` is in the node's local coordinate system, where (0, 0) is the top left corner of the node.

**Note** : enter and exit events are already sent as a side effect of `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#moveTo(androidx.compose.ui.geometry.Offset,kotlin.Long)` when necessary. Whether or not this is part of the contract of trackpad events is platform dependent, so it is highly discouraged to manually send enter or exit events. Only use this method for tests that need to make assertions about a component's state *in between* the enter/exit and move event.

| Parameters |
|---|---|
| `position: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset = currentPosition` | The new position of the trackpad, in the node's local coordinate system. `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#currentPosition()` by default. |
| `delayMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html = eventPeriodMillis` | The time between the last sent event and this event. `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#eventPeriodMillis()` by default. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if buttons are down, or if the trackpad is already hovering. |

### exit

Cmn Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

```
fun exit(position: Offset = currentPosition, delayMillis: Long = eventPeriodMillis): Unit
```

Sends a hover exit event at the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#exit(androidx.compose.ui.geometry.Offset,kotlin.Long)`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#exit(androidx.compose.ui.geometry.Offset,kotlin.Long)` after the last sent event, without sending a hover move event.

The `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#exit(androidx.compose.ui.geometry.Offset,kotlin.Long)` is in the node's local coordinate system, where (0, 0) is the top left corner of the node.

**Note** : enter and exit events are already sent as a side effect of `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#moveTo(androidx.compose.ui.geometry.Offset,kotlin.Long)` when necessary. Whether or not this is part of the contract of trackpad events is platform dependent, so it is highly discouraged to manually send enter or exit events. Only use this method for tests that need to make assertions about a component's state *in between* the enter/exit and move event.

| Parameters |
|---|---|
| `position: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset = currentPosition` | The new position of the trackpad, in the node's local coordinate system `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#currentPosition()` by default. |
| `delayMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html = eventPeriodMillis` | The time between the last sent event and this event. `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#eventPeriodMillis()` by default. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if the trackpad was not hovering. |

### moveBy

Cmn Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

```
open fun moveBy(delta: Offset, delayMillis: Long = eventPeriodMillis): Unit
```

Sends a move event `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#moveBy(androidx.compose.ui.geometry.Offset,kotlin.Long)` after the last sent event on the associated node, with the position of the trackpad moved by the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#moveBy(androidx.compose.ui.geometry.Offset,kotlin.Long)`.

If no buttons are pressed, a hover event will be sent instead of a move event. If the trackpad wasn't hovering yet, a hover enter event is sent as well.

| Parameters |
|---|---|
| `delta: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | The position for this move event, relative to the current position of the trackpad. For example, \`delta = Offset(10.px, -10.px) will add 10.px to the trackpad's x-position, and subtract 10.px from the trackpad's y-position. |
| `delayMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html = eventPeriodMillis` | The time between the last sent event and this event. `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#eventPeriodMillis()` by default. |

### moveTo

Cmn Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

```
fun moveTo(position: Offset, delayMillis: Long = eventPeriodMillis): Unit
```

Sends a move event `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#moveTo(androidx.compose.ui.geometry.Offset,kotlin.Long)` after the last sent event on the associated node, with the position of the trackpad updated to `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#moveTo(androidx.compose.ui.geometry.Offset,kotlin.Long)`. The `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#moveTo(androidx.compose.ui.geometry.Offset,kotlin.Long)` is in the node's local coordinate system, where (0, 0) is the top left corner of the node.

If no buttons are pressed, a hover event will be sent instead of a move event. If the trackpad wasn't hovering yet, a hover enter event is sent as well.

| Parameters |
|---|---|
| `position: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | The new position of the trackpad, in the node's local coordinate system |
| `delayMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html = eventPeriodMillis` | The time between the last sent event and this event. `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#eventPeriodMillis()` by default. |

### panEnd

Cmn Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

```
fun panEnd(delayMillis: Long = eventPeriodMillis): Unit
```

Ends a pan gesture. The `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventType#PanEnd()` will be sent at the current event time.

The helper function `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).pan(androidx.compose.ui.geometry.Offset)` allows combining these calls into a single call, to pan by a given offset sending the appropriate event in sequence.

| Parameters |
|---|---|
| `delayMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html = eventPeriodMillis` | The time between the last sent event and this event. `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#eventPeriodMillis()` by default. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if the trackpad is not in a pan gesture started by `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#panStart()`. |

### panMoveBy

Cmn Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

```
fun panMoveBy(delta: Offset, delayMillis: Long = eventPeriodMillis): Unit
```

Updates the ongoing pan gesture, by applying the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#panMoveBy(androidx.compose.ui.geometry.Offset,kotlin.Long)` as part of the pan. The `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventType#PanMove()` will be sent at the current event time.

The helper function `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).pan(androidx.compose.ui.geometry.Offset)` allows combining these calls into a single call, to pan by a given offset sending the appropriate event in sequence.

| Parameters |
|---|---|
| `delta: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | the incremental change in the pan offset. |
| `delayMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html = eventPeriodMillis` | The time between the last sent event and this event. `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#eventPeriodMillis()` by default. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if the trackpad is not in a pan gesture started by `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#panStart()`. |

### panStart

Cmn Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

```
fun panStart(): Unit
```

Starts a pan gesture. The `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventType#PanStart()` will be sent at the current event time. This should be followed by any number of calls to `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#panMoveBy(androidx.compose.ui.geometry.Offset,kotlin.Long)`, followed by `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#panEnd(kotlin.Long)`.

The helper function `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).pan(androidx.compose.ui.geometry.Offset)` allows combining these calls into a single call, to pan by a given offset sending the appropriate event in sequence.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if the trackpad was already sending a pan gesture. |

### press

Cmn Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

```
fun press(button: TrackpadButton = TrackpadButton.Primary): Unit
```

Sends a down and button pressed event for the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#press(androidx.compose.ui.test.TrackpadButton)` on the associated node. When no buttons were down yet, this will exit hovering mode before the button is pressed. All events will be sent at the current event time. Trackpads behave similarly to mice, with platform interpreted gestures that send button events.

| Parameters |
|---|---|
| `button: https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton = TrackpadButton.Primary` | The button that is pressed. By default, the primary button. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#press(androidx.compose.ui.test.TrackpadButton)` is already pressed. |

### release

Cmn Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

```
fun release(button: TrackpadButton = TrackpadButton.Primary): Unit
```

Sends a button released and up event for the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#release(androidx.compose.ui.test.TrackpadButton)` on the associated node. If this was the last button to be released, the trackpad will enter hovering mode and send an accompanying trackpad move event after the button has been released. All events will be sent at the current event time. Trackpads behave similarly to mice, with platform interpreted gestures that send button events.

| Parameters |
|---|---|
| `button: https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton = TrackpadButton.Primary` | The button that is released. By default, the primary button. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#release(androidx.compose.ui.test.TrackpadButton)` is not pressed. |

### scaleChangeBy

Cmn Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

```
fun scaleChangeBy(
    scaleFactor: @FloatRange(from = 0.0, fromInclusive = false) Float,
    delayMillis: Long = eventPeriodMillis
): Unit
```

Updates the ongoing scale gesture, by applying the given multiplicative `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#scaleChangeBy(kotlin.Float,kotlin.Long)` as part of the gesture. The `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventType#ScaleChange()` will be sent at the current event time.

The helper function `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).scale(kotlin.Float)` allows combining these calls into a single call, to scale by a given factor sending the appropriate events in sequence.

| Parameters |
|---|---|
| `scaleFactor: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, fromInclusive = false) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the incremental multiplicative change in the scale factor. |
| `delayMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html = eventPeriodMillis` | The time between the last sent event and this event. `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#eventPeriodMillis()` by default. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if the trackpad is not in a scale gesture started by `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#scaleStart()`. |

### scaleEnd

Cmn Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

```
fun scaleEnd(delayMillis: Long = eventPeriodMillis): Unit
```

Ends a scale gesture. The `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventType#ScaleEnd()` will be sent at the current event time.

The helper function `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).scale(kotlin.Float)` allows combining these calls into a single call, to scale by a given factor sending the appropriate events in sequence.

| Parameters |
|---|---|
| `delayMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html = eventPeriodMillis` | The time between the last sent event and this event. `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#eventPeriodMillis()` by default. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if the trackpad is not in a scale gesture started by `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#scaleStart()`. |

### scaleStart

Cmn Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

```
fun scaleStart(): Unit
```

Starts a scale gesture. The `https://developer.android.com/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventType#ScaleStart()` will be sent at the current event time. This should be followed by any number of calls to `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#scaleChangeBy(kotlin.Float,kotlin.Long)`, followed by `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#scaleEnd(kotlin.Long)`.

The helper function `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).scale(kotlin.Float)` allows combining these calls into a single call, to scale by a given factor sending the appropriate events in sequence.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if the trackpad was already sending a scale gesture. |

### updatePointerBy

Cmn Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

```
open fun updatePointerBy(delta: Offset): Unit
```

Updates the position of the trackpad by the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#updatePointerBy(androidx.compose.ui.geometry.Offset)`, but does not send a move or hover event. This can be useful to adjust the trackpad position before sending for example a `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#press(androidx.compose.ui.test.TrackpadButton)` event.

| Parameters |
|---|---|
| `delta: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | The position for this move event, relative to the current position of the trackpad. For example, \`delta = Offset(10.px, -10.px) will add 10.px to the trackpad's x-position, and subtract 10.px from the trackpad's y-position. |

### updatePointerTo

Cmn Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

```
fun updatePointerTo(position: Offset): Unit
```

Updates the position of the trackpad to the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#updatePointerTo(androidx.compose.ui.geometry.Offset)`, but does not send a move or hover event. This can be useful to adjust the trackpad position before sending for example a `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#press(androidx.compose.ui.test.TrackpadButton)` event. The `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#updatePointerTo(androidx.compose.ui.geometry.Offset)` is in the node's local coordinate system, where (0.px, 0.px) is the top left corner of the node.

| Parameters |
|---|---|
| `position: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | The new position of the trackpad, in the node's local coordinate system |

## Public properties

### currentPosition

Cmn

```
val currentPosition: Offset
```

Returns the current position of the cursor. The position is returned in the local coordinate system of the node with which we're interacting. (0, 0) is the top left corner of the node. If none of the move or updatePointer methods have been used yet, the trackpad's position will be (0, 0) in the Compose host's coordinate system, which will be `-[topLeft]` in the node's local coordinate system.

## Extension functions

### TrackpadInjectionScope.animateMoveAlong

Cmn Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/TrackpadInjectionScope.kt+function:animateMoveAlong)

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

Move the trackpad along the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).animateMoveAlong(kotlin.Function1,kotlin.Long)`, sending a stream of move events to get an animated path of `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).animateMoveAlong(kotlin.Function1,kotlin.Long)` 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 `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).animateMoveAlong(kotlin.Function1,kotlin.Long)` 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:

```kotlin
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.test.animateMoveAlong
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.performTrackpadInput

composeTestRule.onNodeWithTag("myComponent").performTrackpadInput {
    // Hover over the node, making a full circle with a radius of 100px
    val r = 100f
    animateMoveAlong(
        curve = {
            val angle = 2 * PI * it / 1000
            center + Offset(r * cos(angle).toFloat(), r * sin(angle).toFloat())
        },
        durationMillis = 1000L,
    )
}
```

| Parameters |
|---|---|
| `curve: (timeMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) -> https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | 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: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html = DefaultTrackpadGestureDurationMillis` | The duration of the gesture. By default, 300 milliseconds. |

### TrackpadInjectionScope.animateMoveBy

Cmn Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/TrackpadInjectionScope.kt+function:animateMoveBy)

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

Move the trackpad from the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#currentPosition()` by the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).animateMoveBy(androidx.compose.ui.geometry.Offset,kotlin.Long)`, sending a stream of move events to get an animated path of `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).animateMoveBy(androidx.compose.ui.geometry.Offset,kotlin.Long)` milliseconds.

| Parameters |
|---|---|
| `delta: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | 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: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html = DefaultTrackpadGestureDurationMillis` | The duration of the gesture. By default, 300 milliseconds. |

### TrackpadInjectionScope.animateMoveTo

Cmn Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/TrackpadInjectionScope.kt+function:animateMoveTo)

```
fun TrackpadInjectionScope.animateMoveTo(
    position: Offset,
    durationMillis: Long = DefaultTrackpadGestureDurationMillis
): Unit
```

Move the trackpad from the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#currentPosition()` to the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).animateMoveTo(androidx.compose.ui.geometry.Offset,kotlin.Long)`, sending a stream of move events to get an animated path of `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).animateMoveTo(androidx.compose.ui.geometry.Offset,kotlin.Long)` milliseconds. `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#moveTo(androidx.compose.ui.geometry.Offset,kotlin.Long)` the trackpad to the desired start position if you want to start from a different position. The `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).animateMoveTo(androidx.compose.ui.geometry.Offset,kotlin.Long)` 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:

```kotlin
import androidx.compose.ui.test.animateMoveTo
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.performTrackpadInput

composeTestRule.onNodeWithTag("myComponent").performTrackpadInput {
    // Hover over the node, making an X shape
    moveTo(topLeft)
    animateMoveTo(bottomRight)
    // Note that an actual user wouldn't be able to instantly
    // move from the bottom right to the top right
    advanceEventTime()
    moveTo(topRight)
    animateMoveTo(bottomLeft)
}
```

| Parameters |
|---|---|
| `position: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | The position where to move the trackpad to, in the node's local coordinate system |
| `durationMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html = DefaultTrackpadGestureDurationMillis` | The duration of the gesture. By default, 300 milliseconds. |

### TrackpadInjectionScope.click

Cmn Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/TrackpadInjectionScope.kt+function:click)

```
fun TrackpadInjectionScope.click(
    position: Offset = center,
    button: TrackpadButton = TrackpadButton.Primary
): Unit
```

Use `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).click(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` to click on `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).click(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)`, or on the current cursor position if `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).click(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` is `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset#Unspecified()`. The `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).click(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` is in the node's local coordinate system, where (0, 0) is the top left corner of the node. The default `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).click(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` is the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton#Primary()` button.

| Parameters |
|---|---|
| `position: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset = center` | The position where to click, in the node's local coordinate system. If omitted, the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#center()` of the node will be used. If `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset#Unspecified()`, clicks on the current trackpad position. |
| `button: https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton = TrackpadButton.Primary` | The button to click with. Uses the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton#Primary()` by default. |

### TrackpadInjectionScope.doubleClick

Cmn Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/TrackpadInjectionScope.kt+function:doubleClick)

```
fun TrackpadInjectionScope.doubleClick(
    position: Offset = center,
    button: TrackpadButton = TrackpadButton.Primary
): Unit
```

Use `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).doubleClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` to double-click on `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).doubleClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)`, or on the current trackpad position if `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).doubleClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` is `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset#Unspecified()`. The `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).doubleClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` is in the node's local coordinate system, where (0, 0) is the top left corner of the node. The default `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).doubleClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` is the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton#Primary()` button.

| Parameters |
|---|---|
| `position: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset = center` | The position where to click, in the node's local coordinate system. If omitted, the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#center()` of the node will be used. If `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset#Unspecified()`, clicks on the current trackpad position. |
| `button: https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton = TrackpadButton.Primary` | The button to click with. Uses the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton#Primary()` by default. |

### TrackpadInjectionScope.dragAndDrop

Cmn Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/TrackpadInjectionScope.kt+function:dragAndDrop)

```
fun TrackpadInjectionScope.dragAndDrop(
    start: Offset,
    end: Offset,
    button: TrackpadButton = TrackpadButton.Primary,
    durationMillis: Long = DefaultTrackpadGestureDurationMillis
): Unit
```

Use `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).dragAndDrop(androidx.compose.ui.geometry.Offset,androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton,kotlin.Long)` to drag and drop something from `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).dragAndDrop(androidx.compose.ui.geometry.Offset,androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton,kotlin.Long)` to `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).dragAndDrop(androidx.compose.ui.geometry.Offset,androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton,kotlin.Long)` in `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).dragAndDrop(androidx.compose.ui.geometry.Offset,androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton,kotlin.Long)` milliseconds. The trackpad position is `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadInjectionScope#updatePointerTo(androidx.compose.ui.geometry.Offset)` to the start position before starting the gesture. The positions defined by the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).dragAndDrop(androidx.compose.ui.geometry.Offset,androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton,kotlin.Long)` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).dragAndDrop(androidx.compose.ui.geometry.Offset,androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton,kotlin.Long)` are in the node's local coordinate system, where (0, 0) is the top left corner of the node.

| Parameters |
|---|---|
| `start: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | The position where to press the primary button and initiate the drag, in the node's local coordinate system. |
| `end: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | The position where to release the primary button and end the drag, in the node's local coordinate system. |
| `button: https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton = TrackpadButton.Primary` | The button to drag with. Uses the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton#Primary()` by default. |
| `durationMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html = DefaultTrackpadGestureDurationMillis` | The duration of the gesture. By default, 300 milliseconds. |

### TrackpadInjectionScope.longClick

Cmn Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/TrackpadInjectionScope.kt+function:longClick)

```
fun TrackpadInjectionScope.longClick(
    position: Offset = center,
    button: TrackpadButton = TrackpadButton.Primary
): Unit
```

Use `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).longClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` to long-click on `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).longClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)`, or on the current trackpad position if `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).longClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` is `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset#Unspecified()`. The `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).longClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` is in the node's local coordinate system, where (0, 0) is the top left corner of the node. The default `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).longClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` is the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton#Primary()` button.

| Parameters |
|---|---|
| `position: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset = center` | The position where to click, in the node's local coordinate system. If omitted, the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#center()` of the node will be used. If `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset#Unspecified()`, clicks on the current trackpad position. |
| `button: https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton = TrackpadButton.Primary` | The button to click with. Uses the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton#Primary()` by default. |

### TrackpadInjectionScope.pan

Cmn Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/TrackpadInjectionScope.kt+function:pan)

```
fun TrackpadInjectionScope.pan(offset: Offset): Unit
```

Sends a pan gesture with the given total `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).pan(androidx.compose.ui.geometry.Offset)`. The event will be sent starting at the current event time.

To send a pan gesture with a curve, use `pan(curve, durationMillis, keyTimes)`.

```kotlin
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.pan
import androidx.compose.ui.test.performTrackpadInput

composeTestRule.onNodeWithTag("verticalScrollable").performTrackpadInput {
    pan(Offset(0f, 100f))
}
```

| Parameters |
|---|---|
| `offset: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | The amount of pan |

### TrackpadInjectionScope.pan

Cmn Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/TrackpadInjectionScope.kt+function:pan)

```
fun TrackpadInjectionScope.pan(
    curve: (timeMillis: Long) -> Offset,
    durationMillis: Long = 200,
    keyTimes: List<Long> = emptyList()
): Unit
```

Sends a pan gesture with the offsets in the panning coordinate space following the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).pan(kotlin.Function1,kotlin.Long,kotlin.collections.List)`. It is expected that the curve starts at `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset#Zero()`, as a pan gesture starts with no delta, and then move outward from the origin.

To send a pan with just a single amount, use `pan(offset)`.

| Parameters |
|---|---|
| `curve: (timeMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) -> https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | The function that describes the gesture. The argument passed to the function is the time in milliseconds since the start of the swipe, and the return value is the location of the pan from the origin at that point in time. |
| `durationMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html = 200` | The duration of the gesture |
| `keyTimes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html> = emptyList()` | An optional list of timestamps in milliseconds at which a pan move event must be sampled |

### TrackpadInjectionScope.panWithVelocity

Cmn Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/TrackpadInjectionScope.kt+function:panWithVelocity)

```
fun TrackpadInjectionScope.panWithVelocity(
    offset: Offset,
    endVelocity: @FloatRange(from = 0.0) Float,
    durationMillis: Long = VelocityPathFinder.calculateDefaultDuration(Offset.Zero, offset, endVelocity)
): Unit
```

Performs a pan gesture on the associated node such that it ends with the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).panWithVelocity(androidx.compose.ui.geometry.Offset,kotlin.Float,kotlin.Long)`.

The pan will go from `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset#Zero()` at t=0 to `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).panWithVelocity(androidx.compose.ui.geometry.Offset,kotlin.Float,kotlin.Long)` at t=`https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).panWithVelocity(androidx.compose.ui.geometry.Offset,kotlin.Float,kotlin.Long)`. In between, the pan will go monotonically from `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset#Zero()` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).panWithVelocity(androidx.compose.ui.geometry.Offset,kotlin.Float,kotlin.Long)`, but not strictly. Due to imprecision, no guarantees can be made for the actual velocity at the end of the gesture, but generally it is within 0.1 of the desired velocity.

When a pan cannot be created that results in the desired velocity (because the input is too restrictive), an exception will be thrown with suggestions to fix the input.

The coordinates are in the pan coordinate system, which has the same scale as the display in pixel coordinates, where `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset#Zero()` indicates no panning.

Use `pan(curve, duration, durationMillis)` to directly control the curve of the pan.

| Parameters |
|---|---|
| `offset: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | The end position of the pan |
| `endVelocity: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The velocity of the gesture at the moment it ends in px/second. Must be positive. |
| `durationMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html = VelocityPathFinder.calculateDefaultDuration(Offset.Zero, offset, endVelocity)` | The duration of the gesture in milliseconds. Must be long enough that at least 3 input events are generated, which happens with a duration of 40ms or more. If omitted, a duration is calculated such that a valid pan with velocity can be created. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | When no pan can be generated that will result in the desired velocity. The error message will suggest changes to the input parameters such that a pan will become feasible. |

### TrackpadInjectionScope.rightClick

Cmn Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/TrackpadInjectionScope.kt+function:rightClick)

```
fun TrackpadInjectionScope.rightClick(position: Offset = center): Unit
```

Secondary-click on `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).rightClick(androidx.compose.ui.geometry.Offset)`, or on the current cursor position if `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).rightClick(androidx.compose.ui.geometry.Offset)` is `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset#Unspecified()`. While the secondary button is not necessarily a physical right button (e.g. a multi-finger tap), this method is still called `rightClick` for its widespread use. The `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).rightClick(androidx.compose.ui.geometry.Offset)` is in the node's local coordinate system, where (0, 0) is the top left corner of the node.

| Parameters |
|---|---|
| `position: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset = center` | The position where to click, in the node's local coordinate system. If omitted, the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#center()` of the node will be used. If `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset#Unspecified()`, clicks on the current trackpad position. |

### TrackpadInjectionScope.scale

Cmn Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/TrackpadInjectionScope.kt+function:scale)

```
fun TrackpadInjectionScope.scale(
    scaleFactor: @FloatRange(from = 0.0, fromInclusive = false) Float
): Unit
```

Sends a scale event with the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).scale(kotlin.Float)`. The event will be sent starting at the current event time.

The `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).scale(kotlin.Float)` is a multiplicative zoom factor. A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).scale(kotlin.Float)` of 1 represents no change. A `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).scale(kotlin.Float)` less than 1 represents a "zoom out" gesture, while a factor of more than one represents a "zoom in" gesture.

```kotlin
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.performTrackpadInput
import androidx.compose.ui.test.scale

composeTestRule.onNodeWithTag("transformable").performTrackpadInput {
    // Performs a scale with a factor of 0.9f, which corresponds to a "zoom out" gesture.
    scale(0.9f)
}
```

| Parameters |
|---|---|
| `scaleFactor: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, fromInclusive = false) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The amount to scale. |

### TrackpadInjectionScope.tripleClick

Cmn Artifact: [androidx.compose.ui:ui-test](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/test/TrackpadInjectionScope.kt+function:tripleClick)

```
fun TrackpadInjectionScope.tripleClick(
    position: Offset = center,
    button: TrackpadButton = TrackpadButton.Primary
): Unit
```

Use `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).tripleClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` to triple-click on `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).tripleClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)`, or on the current trackpad position if `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).tripleClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` is `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset#Unspecified()`. The `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).tripleClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` is in the node's local coordinate system, where (0, 0) is the top left corner of the node. The default `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.TrackpadInjectionScope).tripleClick(androidx.compose.ui.geometry.Offset,androidx.compose.ui.test.TrackpadButton)` is the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton#Primary()` button.

| Parameters |
|---|---|
| `position: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset = center` | The position where to click, in the node's local coordinate system. If omitted, the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/InjectionScope#center()` of the node will be used. If `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset#Unspecified()`, clicks on the current trackpad position. |
| `button: https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton = TrackpadButton.Primary` | The button to click with. Uses the `https://developer.android.com/reference/kotlin/androidx/compose/ui/test/TrackpadButton#Primary()` by default. |