Source set: Common
public sealed interface MultiModalInjectionScope : InjectionScope
Functions
touch
Source set: Common
public fun touch(block: TouchInjectionScope.() -> Unit)
Injects all touch events sent by the given block
indirectPointer
Source set: Common
public fun indirectPointer(
indirectPointerEventPrimaryDirectionalMotionAxis:
IndirectPointerEventPrimaryDirectionalMotionAxis,
inputDeviceSize: IntSize,
block: IndirectPointerInjectionScope.() -> Unit,
)
Injects all indirect pointer events sent by the given block. This API requires an active focus state meaning developers need to request focus to the component or a child of the component via SemanticsNodeInteraction.requestFocus() before calling this function. If no component is currently focused, the event will not trigger.
Parameters
| indirectPointerEventPrimaryDirectionalMotionAxis | The main movement axis (horizontal or vertical) for single-directional scrolling when using the touchpad inputDeviceSize. For instance, if the primary axis is set to X, a display prioritizes scrolling its content (for both horizontal and vertical containers) based on the device's X-axis movement. Note that this input axis may not correspond directly to the resulting scrolling axis on the display (e.g., X-axis movement causing vertical scrolling). |
| inputDeviceSize | The dimensions of the external indirect pointer input device that provide the boundaries for indirect input. If you go outside these dimensions, the tests will throw an exception. Note: This is not related to the screen coordinates. |
| block | Block of code/events to execute in indirect scope |
mouse
Source set: Common
public fun mouse(block: MouseInjectionScope.() -> Unit)
Injects all mouse events sent by the given block
key
Source set: Common
public fun key(block: KeyInjectionScope.() -> Unit)
Injects all key events sent by the given block
rotary
Source set: Common
public fun rotary(block: RotaryInjectionScope.() -> Unit)
Injects all rotary events sent by the given block
trackpad
Source set: Common
public fun trackpad(block: TrackpadInjectionScope.() -> Unit)
Injects all trackpad events sent by the given block