Hello team, is there a standard way or a library to read/write the clipboard in KMP? I already know how to do it in Android/JVM but looking to do it on native (linux /macOS) as well.
p
Pablichjenkov
04/26/2024, 1:08 PM
I have been using this on the web:
Copy code
@Composable
fun ClipBoardPasteButton(
onPaste: (String) -> Unit
) {
// val clipboardManager = LocalClipboardManager.current
val clipboardManager = window.navigator.clipboard
Button(onClick = {
clipboardManager.readText().then {
onPaste(it)
}
}) {
Text("Paste from Clipboard")
}
}