https://kotlinlang.org logo
#compose-desktop
Title
# compose-desktop
h

Henri Gourvest

02/25/2024, 4:37 PM
I find it annoying that the gesture detector doesn't provide information on keyboard status. This would be useful for combined keyboard and mouse actions in desktop applications. I've duplicated and modified the detector code, but I think it would be something to improve in Jetpack Compose.
Copy code
suspend fun PointerInputScope.detectTapGesturesEx(
    onDoubleTap: ((Offset, PointerKeyboardModifiers) -> Unit)? = null,
    onLongPress: ((Offset, PointerKeyboardModifiers) -> Unit)? = null,
    onPress: suspend PressGestureScope.(Offset, PointerKeyboardModifiers) -> Unit = NoPressGesture,
    onTap: ((Offset, PointerKeyboardModifiers) -> Unit)? = null
) = coroutineScope {...}
z

Zach Klippenstein (he/him) [MOD]

02/26/2024, 6:08 PM
Feel free to file a feature request
h

Henri Gourvest

02/26/2024, 6:16 PM
Alexander put me on the right track in the message just after mine.