---
title: NSTextInputContext
framework: appkit
role: symbol
role_heading: Class
path: appkit/nstextinputcontext
---

# NSTextInputContext

An object that represents the Cocoa text input system.

## Declaration

```swift
class NSTextInputContext
```

## Overview

Overview The text input system communicates primarily with the client of the activated input context via the NSTextInputClient protocol.

## Topics

### Creating an Input Context

- [init(client:)](appkit/nstextinputcontext/init(client:).md)

### Getting the Input Context and Client

- [current](appkit/nstextinputcontext/current.md)
- [client](appkit/nstextinputcontext/client.md)

### Configuring the Input Context

- [acceptsGlyphInfo](appkit/nstextinputcontext/acceptsglyphinfo.md)
- [allowedInputSourceLocales](appkit/nstextinputcontext/allowedinputsourcelocales.md)

### Activating the Input Context

- [activate()](appkit/nstextinputcontext/activate().md)
- [deactivate()](appkit/nstextinputcontext/deactivate().md)

### Handling Input Sources

- [handleEvent(_:)](appkit/nstextinputcontext/handleevent(_:).md)
- [discardMarkedText()](appkit/nstextinputcontext/discardmarkedtext().md)
- [invalidateCharacterCoordinates()](appkit/nstextinputcontext/invalidatecharactercoordinates().md)
- [keyboardInputSources](appkit/nstextinputcontext/keyboardinputsources.md)
- [selectedKeyboardInputSource](appkit/nstextinputcontext/selectedkeyboardinputsource.md)
- [localizedName(forInputSource:)](appkit/nstextinputcontext/localizedname(forinputsource:).md)
- [NSTextInputSourceIdentifier](appkit/nstextinputsourceidentifier.md)

### Notifications

- [keyboardSelectionDidChangeNotification](appkit/nstextinputcontext/keyboardselectiondidchangenotification.md)

### Instance Methods

- [textInputClientDidEndScrollingOrZooming()](appkit/nstextinputcontext/textinputclientdidendscrollingorzooming().md)
- [textInputClientWillStartScrollingOrZooming()](appkit/nstextinputcontext/textinputclientwillstartscrollingorzooming().md)
- [textInputClientDidScroll()](appkit/nstextinputcontext/textinputclientdidscroll().md)
- [textInputClientDidUpdateSelection()](appkit/nstextinputcontext/textinputclientdidupdateselection().md)

### Structures

- [NSTextInputContext.KeyboardSelectionDidChangeMessage](appkit/nstextinputcontext/keyboardselectiondidchangemessage.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Text input

- [Adopting the system text cursor in custom text views](appkit/adopting-the-system-text-cursor-in-custom-text-views.md)
- [NSTextInputClient](appkit/nstextinputclient.md)
- [NSTextAlternatives](appkit/nstextalternatives.md)
- [NSTextContent](appkit/nstextcontent.md)
- [NSTextInsertionIndicator](appkit/nstextinsertionindicator.md)
- [NSTextInsertionIndicator.DisplayMode](appkit/nstextinsertionindicator/displaymode-swift.enum.md)
- [NSTextInsertionIndicator.AutomaticModeOptions](appkit/nstextinsertionindicator/automaticmodeoptions-swift.struct.md)
