# PlatformTextInputSession

Artifact: [androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/platform/PlatformTextInput+class:androidx.compose.ui.platform.PlatformTextInputSession) Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.6.0) Common/AllAndroid/JVM
- Cmn

  ```
  interface PlatformTextInputSession
  ```
Known direct subclasses [PlatformTextInputSessionScope](https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/PlatformTextInputSessionScope)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/PlatformTextInputSessionScope` | A `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/PlatformTextInputSession` that is also a `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-scope/index.html`. |

*** ** * ** ***

Receiver type for `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/package-summary#(androidx.compose.ui.platform.PlatformTextInputModifierNode).establishTextInputSession(kotlin.coroutines.SuspendFunction1)`.

## Summary

| ### Public functions |
|---|---|---|
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-nothing/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/PlatformTextInputSession#startInputMethod(androidx.compose.ui.platform.PlatformTextInputMethodRequest)(request: https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/PlatformTextInputMethodRequest)` Starts the text input session and suspends until it is closed. | Cmn android |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/android/view/View.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/PlatformTextInputSession#view()` The `https://developer.android.com/reference/android/view/View.html` this input session is bound to. | android |

## Public functions

### startInputMethod

Cmn android

```
suspend fun startInputMethod(request: PlatformTextInputMethodRequest): Nothing
```

Starts the text input session and suspends until it is closed.

On platforms that support software keyboards, calling this method will show the keyboard and attempt to keep it visible until the last session is closed.

Calling this method multiple times, within the same `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/package-summary#(androidx.compose.ui.platform.PlatformTextInputModifierNode).establishTextInputSession(kotlin.coroutines.SuspendFunction1)` block or from different `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/package-summary#(androidx.compose.ui.platform.PlatformTextInputModifierNode).establishTextInputSession(kotlin.coroutines.SuspendFunction1)`s, will restart the session each time.

| Parameters |
|---|---|
| `request: https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/PlatformTextInputMethodRequest` | The platform-specific `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/PlatformTextInputMethodRequest` that will be used to initiate the session. |

## Public properties

### view

android Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.6.0)

```
val view: View
```

The `https://developer.android.com/reference/android/view/View.html` this input session is bound to. This view should be used to obtain and interact with the `https://developer.android.com/reference/android/view/inputmethod/InputMethodManager.html`.