PlatformTextInputInterceptor
@ExperimentalComposeUiApi
fun interface PlatformTextInputInterceptor
Single-function interface passed to InterceptPlatformTextInput.
Functions
suspend fun interceptStartInputMethod(
request: PlatformTextInputMethodRequest,
nextHandler: PlatformTextInputSession,
): Nothing
Called when a function passed to
establishTextInputSession calls
startInputMethod. The
PlatformTextInputMethodRequest from the caller is passed to this function as request, and
this function can either respond to the request directly (e.g. recording it for a test), or
wrap the request and pass it to nextHandler. This function must call into nextHandler
if it intends for the system to respond to the request. Not calling into nextHandler has
the effect of blocking the request.
This method has the same ordering guarantees as
startInputMethod. That is, for a given text
input modifier, if startInputMethod is called
multiple times, only one interceptStartInputMethod call will be made at a time, and any
previous call will be allowed to finish running any finally blocks before the new session
starts.
