---
title: "MultiModalInjectionScope"
description: "The receiver scope of the multi-modal input injection lambda from [performMultiModalInput].

[MultiModalInjectionScope] brings together the receiver scopes of all individual modalities,
allowing you to inject gestures that consist of events from different modalities, like touch and
mouse. For each modality, there is a function to which you pass a lambda in which you can inject
events for that modality: currently, we have [touch], [mouse] and [key] functions. See their
respective docs for more information.

Note that all events generated by the gesture methods are batched together and sent as a whole
after [performMultiModalInput] has executed its code block.

Example of performing a click via touch input followed by drag and drop via mouse input:"
type: "interface"
---

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


<a id='references'></a>

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



```kotlin
sealed interface MultiModalInjectionScope : InjectionScope
```


The receiver scope of the multi-modal input injection lambda from `performMultiModalInput`.

`MultiModalInjectionScope` brings together the receiver scopes of all individual modalities,
allowing you to inject gestures that consist of events from different modalities, like touch and
mouse. For each modality, there is a function to which you pass a lambda in which you can inject
events for that modality: currently, we have `touch`, `mouse` and `key` functions. See their
respective docs for more information.

Note that all events generated by the gesture methods are batched together and sent as a whole
after `performMultiModalInput` has executed its code block.

Example of performing a click via touch input followed by drag and drop via mouse input:


## Functions

```kotlin
fun touch(block: TouchInjectionScope.() -> Unit)
```


Injects all touch events sent by the given `block`


```kotlin
fun mouse(block: MouseInjectionScope.() -> Unit)
```


Injects all mouse events sent by the given `block`


```kotlin
fun key(block: KeyInjectionScope.() -> Unit)
```


Injects all key events sent by the given `block`


```kotlin
fun rotary(block: RotaryInjectionScope.() -> Unit)
```


Injects all rotary events sent by the given `block`


```kotlin
fun trackpad(block: TrackpadInjectionScope.() -> Unit)
```


Injects all trackpad events sent by the given `block`



## Code Examples

### multiModalInputClickDragDrop
```kotlin
fun multiModalInputClickDragDrop() {
    composeTestRule.onNodeWithTag("myComponent").performMultiModalInput {
        touch { click(center) }
        advanceEventTime(500)
        mouse { dragAndDrop(topLeft, bottomRight) }
    }
}
```

