---
title: "isMetaPressed"
description: "Indicates whether the Meta key is pressed."
type: "property"
---

<div class='type'>Property</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
expect val KeyEvent.isMetaPressed: Boolean
```


Indicates whether the Meta key is pressed.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
expect val PointerKeyboardModifiers.isMetaPressed: Boolean
```


`true` when the Meta key is pressed. This is commonly associated with the Windows or Command key
on some keyboards.



<div class='sourceset sourceset-android'>Android</div>


```kotlin
actual val KeyEvent.isMetaPressed: Boolean
```


Indicates whether the Meta key is pressed.



<div class='sourceset sourceset-android'>Android</div>


```kotlin
actual val PointerKeyboardModifiers.isMetaPressed: Boolean
```


## Code Examples

### KeyEventIsMetaPressedSample
```kotlin
@Composable
fun KeyEventIsMetaPressedSample() {
    Box(
        Modifier.onKeyEvent {
                if (it.isMetaPressed && it.key == Key.A) {
                    println("Meta + A is pressed")
                    true
                } else {
                    false
                }
            }
            .focusable()
    )
}
```

