package ch.dissem.yaep.ui.common

import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.PointerMatcher
import androidx.compose.foundation.PointerMatcher.Companion.mouse
import androidx.compose.foundation.onClick
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.pointer.PointerButton.Companion.Secondary

@OptIn(ExperimentalFoundationApi::class)
actual fun Modifier.onPointerAction(primary: () -> Unit, secondary: () -> Unit): Modifier {
    return this
        .onClick(matcher = PointerMatcher.Primary, onClick = primary)
        .onClick(matcher = mouse(Secondary), onClick = secondary)
}