PlatformTextInputService

Added in 1.0.0
Deprecated in 1.7.0-alpha04

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
open Unit

Restart input and show the 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)

Notify the new editor model to IME.

Cmn
open Unit
updateTextLayoutResult(
    textFieldValue: TextFieldValue,
    offsetMapping: OffsetMapping,
    textLayoutResult: TextLayoutResult,
    textFieldToRootTransform: (Matrix) -> Unit,
    innerTextFieldBounds: Rect,
    decorationBoxBounds: Rect
)

Notify the input service of layout and position changes.

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

open fun startInput(): Unit

Restart input and show the keyboard. This should only be called when starting a new PlatformTextInputModifierNode.textInputSession.

See also
startInput

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

Notify the new editor model to IME.

See also
updateState

updateTextLayoutResult

open fun updateTextLayoutResult(
    textFieldValue: TextFieldValue,
    offsetMapping: OffsetMapping,
    textLayoutResult: TextLayoutResult,
    textFieldToRootTransform: (Matrix) -> Unit,
    innerTextFieldBounds: Rect,
    decorationBoxBounds: Rect
): Unit

Notify the input service of layout and position changes.