setInput

fun RunScope.setInput(text: String, cursorIndex: Int = text.length, id: Any = Unit)

Set the value for some input call directly from anywhere in a RunScope.run block.

This should be extremely rare to do! But perhaps you need to set the text asynchronously (e.g. onInputEntered is blocking) or inside on onKeyPressed callback, etc.

However, try using onInputChanged, onInputEntered, etc. first. This will result in code that is easier for readers to follow.

See also: input, getInput

Parameters

text

The text to replace the current input with

cursorIndex

If specified, the index of the cursor position; otherwise, it will be placed after the end of the text.

id

If set, find the input with the matching ID. This can be useful if you have multiple input blocks defined at the same time.