{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

PlatformTextInputService


Platform specific text input service.

Summary

Public functions

Unit

Hide software keyboard

Cmn
open Unit

Notify the focused rectangle to the system.

Cmn
Unit

Request showing onscreen keyboard

Cmn
Unit
startInput(
    value: TextFieldValue,
    imeOptions: ImeOptions,
    onEditCommand: (List<EditCommand>) -> Unit,
    onImeActionPerformed: (ImeAction) -> Unit
)

Start text input session for given client.

Cmn
Unit

Stop text input session.

Cmn
Unit
updateState(oldValue: TextFieldValue?, newValue: TextFieldValue)
Cmn

Public functions

hideSoftwareKeyboard

fun hideSoftwareKeyboard(): Unit

Hide software keyboard

notifyFocusedRect

open fun notifyFocusedRect(rect: Rect): Unit

Notify the focused rectangle to the system.

The system can ignore this information or use it to for additional functionality.

For example, desktop systems show a popup near the focused input area (for some languages).

showSoftwareKeyboard

fun showSoftwareKeyboard(): Unit

Request showing onscreen keyboard

There is no guarantee nor callback of the result of this API.

startInput

fun startInput(
    value: TextFieldValue,
    imeOptions: ImeOptions,
    onEditCommand: (List<EditCommand>) -> Unit,
    onImeActionPerformed: (ImeAction) -> Unit
): Unit

Start text input session for given client.

See also
startInput

stopInput

fun stopInput(): Unit

Stop text input session.

See also
stopInput

updateState

fun updateState(oldValue: TextFieldValue?, newValue: TextFieldValue): Unit