https://kotlinlang.org logo
Title
w

wilddev

10/14/2021, 6:35 PM
Hi, is it possible in "compose" or "compose-desktop" to handle something like onMouseDown? Tried Modifier.pointerInput/detectTapGestures, but that is called only like onMouseUp
c

Christopher Porto

10/14/2021, 8:25 PM
If by mouse down you mean drag by holding mouse button and moving mouse down then you can use
Modifier.draggable(
    state = DraggableState {
        if (it > 0.0) {
            println("Moving down")
        } else {
            println("Moving up")
        }
    },
    orientation = Orientation.Vertical
)
If you mean on mouse click then you can use
Modifier.mouseClickable
z

Zach Klippenstein (he/him) [MOD]

10/17/2021, 1:36 PM
Pointer input should get mouse down too, are you sure something wasn't intercepting it?