longPressKey
suspend fun longPressKey(keyCode: Int, duration: Duration? = null, count: Int = 1, interval: Duration = 100.milliseconds, timeout: Duration? = null)(source)
Holds an Android key code down, count times, as pressKey. Without duration each press lasts the device's long-press timeout and sends the repeat Android reports as a long press (KeyEvent.FLAG_LONG_PRESS). With duration (1..30000 ms) it stays down that long and repeats as a held key does, so holding Volume Down steps the volume; the repeat at the long-press timeout is the long press. The sequence must fit in 30000 ms, a long press counted at 1500 ms (the longest long-press timeout Android offers).