---
title: "isShiftPressed"
description: "Indicates whether the Shift 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.isShiftPressed: Boolean
```


Indicates whether the Shift key is pressed.



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


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


`true` when the Shift key is pressed.



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


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


Indicates whether the Shift key is pressed.



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


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


## Code Examples

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

