---
title: specialKey
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsevent/specialkey-swift.property
---

# specialKey

The code associated with a function key or other special key.

## Declaration

```swift
var specialKey: NSEvent.SpecialKey? { get }
```

## Discussion

Discussion When someone presses a special function key, this property contains the code for that key. For other keys, this property is nil.

## See Also

### Getting key event information

- [characters](appkit/nsevent/characters.md)
- [charactersIgnoringModifiers](appkit/nsevent/charactersignoringmodifiers.md)
- [keyCode](appkit/nsevent/keycode.md)
- [characters(byApplyingModifiers:)](appkit/nsevent/characters(byapplyingmodifiers:).md)
- [keyRepeatDelay](appkit/nsevent/keyrepeatdelay.md)
- [keyRepeatInterval](appkit/nsevent/keyrepeatinterval.md)
- [Function-Key Unicode Values](appkit/function-key-unicode-values.md)
- [NSEvent.SpecialKey](appkit/nsevent/specialkey-swift.struct.md)
- [isARepeat](appkit/nsevent/isarepeat.md)
