keystroke

open fun keystroke(fieldName: String, change: String, selectionStart: Int, selectionEnd: Int): String?

The reader typed into a field. change is what is being inserted, replacing the text between selectionStart and selectionEnd.

Returns the value the field should show, or null when a script refused the change.