Is there any way for me to be able to detect a mou...
# compose-desktop
k
Is there any way for me to be able to detect a mouse release over something? I want to be able to click and drag on something (already handled), but then release the mouse over something else and run code on that other thing. I'm trying to connect two nodes in a node graph with wires and I'm not sure how to "drop" the wire onto the pin because I don't know how to detect mouse release without a mouse click.
i
You can use low-level pointer API:
Copy code
Modifier.pointerInput(Unit) {
    awaitPointerEventScope {
        while (true) {
            val event = awaitPointerEvent()
            if (event.type == PointerEventType.Release) {
                event.changes.first().position
            }
        }
    }
}