---
title: "performKeyPress"
description: "Send the specified [KeyEvent] to the focused component."
type: "function"
---

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


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun SemanticsNodeInteraction.performKeyPress(keyEvent: KeyEvent): Boolean
```


Send the specified `KeyEvent` to the focused component.

#### Returns

| | |
| --- | --- |
|  | true if the event was consumed. False otherwise. |




