InputHelper

The InputHelper is a helper class to perform operations related to the current input connection

replaceText Replaces a composing region with the provided text
removeText Removes a composing region
insertText Inserts text at the composing position
clearText Removes all text from the current editor

ReplaceText

Replaces content, in the region delimited by start and end, with the provided text.

Notes:

  • Start should be equal or greater than 0
  • The provided end position should be greater than the start position
fun replaceText(start: Int, end: Int, text: String)

RemoveText

Removes content in the region delimited by start and end.

Notes:

  • Start should be equal or greater than 0
  • The provided end position should be greater than the start position
fun removeText(start: Int, end: Int)

InsertText

Inserts text at the provided position

Notes:

  • Position should be equal or greater than 0
fun insertText(position: Int, text: String)

ClearText

Removes all text on the underlying editor

fun clearText()

If something needs to be added or if you find an error in our documentation, please let us know either on our GitHub or Discord.

Last updated on April 23, 2022