---
title: characters
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsevent/characters
---

# characters

The characters associated with a key-up or key-down event.

## Declaration

```swift
var characters: String? { get }
```

## Discussion

Discussion These characters are derived from a keyboard mapping that associates various key combinations with Unicode characters. This property is only valid for key-up and key-down events. It raises an NSInternalInconsistencyException if accessed on any other kind of event object. This property is set to an empty string for dead keys, such as Option-e. However, for a key combination such as Option-Shift-e this property is set to the standard accent (“´”). For a list of constants corresponding to commonly-used Unicode characters, see NSText.

## See Also

### Related Documentation

- [keyEvent(with:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:)](appkit/nsevent/keyevent(with:location:modifierflags:timestamp:windownumber:context:characters:charactersignoringmodifiers:isarepeat:keycode:).md)

### Getting key event information

- [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)
- [specialKey](appkit/nsevent/specialkey-swift.property.md)
- [Function-Key Unicode Values](appkit/function-key-unicode-values.md)
- [NSEvent.SpecialKey](appkit/nsevent/specialkey-swift.struct.md)
- [isARepeat](appkit/nsevent/isarepeat.md)
