---
title: key
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uipress/key
---

# key

The key pressed or released on a physical keyboard.

## Declaration

```swift
var key: UIKey? { get }
```

## Mentioned in

Handling key presses made on a physical keyboard

## Discussion

Discussion This property is nil when the press event isn’t from a keyboard; for example, a button press on an Apple TV remote.

## See Also

### Getting press attributes

- [type](uikit/uipress/type.md)
- [phase](uikit/uipress/phase-swift.property.md)
- [timestamp](uikit/uipress/timestamp.md)
