3

I want get the keyboard input in my custom compose?But even i can't show a keybord.

Anyone know how to use it ?help please.

@Composable
fun SmsCodeCompose(onCompleted:(String)->Unit) {
    val textInputService = LocalTextInputService.current

    Text(text = "12112",
    modifier=Modifier.clickable {

            Timber.d("input service= $textInputService")
           val textInputSession = textInputService?.startInput(
                value = TextFieldValue(),
                imeOptions = ImeOptions(),
                onEditCommand = {it-> it.forEach{
                    Timber.d("$it")
                }
                },
                onImeActionPerformed = {}
            )
        textInputSession?.showSoftwareKeyboard()



    }.focusable(true))
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
zxj
  • 31
  • 2

0 Answers0