findShortcut
Intercepts the standard find shortcut (Ctrl+F on Windows, Linux, and Android; Cmd+F on macOS and iOS) and invokes onToggle when triggered. Repeated presses toggle the find bar: onToggle is expected to flip the host's own visibility state.
Apply this directly to the TextEditor's modifier so that the handler is on the focusable node; placing it on a non-focusable ancestor does not reliably receive hardware-keyboard events on Android.
Two interception points are wired up:
onInterceptKeyBeforeSoftKeyboardcatches the event before the Android IME gets to consume it, which is required for hardware/Bluetooth keyboards while the soft keyboard is active.onPreviewKeyEventis the standard Compose key dispatch path used on Desktop and as a fallback on Android when no IME is in play.
Both handlers consume the event so the editor doesn't see Ctrl+F as a typed character.
findShortcut plus find next and previous while state has a query: F3 and Shift+F3, and Ctrl+G and Ctrl+Shift+G (Cmd on macOS and iOS). Without a query those keys pass through.