Property

isMetaPressed

Indicates whether the Meta key is pressed.

KeyEventIsMetaPressedSample

@Sampled
@Composable
fun KeyEventIsMetaPressedSample() {
    Box(
        Modifier.onKeyEvent {
                if (it.isMetaPressed && it.key == Key.A) {
                    println("Meta + A is pressed")
                    true
                } else {
                    false
                }
            }
            .focusable()
    )
}
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: