pressKey

suspend fun pressKey(keyCode: Int, count: Int = 1, interval: Duration = 100.milliseconds, timeout: Duration? = null)(source)

Presses an Android key code (Keys) count times (a mutation: never replayed on transport loss), interval apart from each release to the next press (40..1000 ms). timeout defaults to the action timeout plus the sequence. Only whether the key events were injected is reported: what the key does is up to the device and the app in front.