withKeysDown

Function

Common
fun KeyInjectionScope.withKeysDown(keys: List<Key>, block: KeyInjectionScope.() -> Unit)

Executes the keyboard sequence specified in the given block, whilst holding down the each of the given keys. Each of the keys will be pressed down and released simultaneously. These keys must not be used within the block.

If any of the given keys are already down, an IllegalStateException will be thrown.

Parameters

keysList of keys to be held down during injection of the block.
blockSequence of KeyInjectionScope methods to be injected with the given keys down.