Class

NSTextInputContext

An object that represents the Cocoa text input system.

Declaration

@interface NSTextInputContext : NSObject

Overview

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

Topics

Creating an Input Context

- initWithClient:

The designated initializer

Getting the Input Context and Client

currentInputContext

Returns the current, activated, text input context object.

client

The owner of this input context. (read-only)

Configuring the Input Context

acceptsGlyphInfo

A Boolean value that indicates whether the client handles NSGlyphInfoAttributeName or not.

allowedInputSourceLocales

The set of keyboard input source locales allowed when this input context is active.

Activating the Input Context

- activate

Activates the receiver.

- deactivate

Deactivates the receiver.

Handling Input Sources

- handleEvent:

Tells the Cocoa text input system to handle mouse or key events.

- discardMarkedText

Tells the Cocoa text input system to discard the current conversion session.

- invalidateCharacterCoordinates

Notifies the Cocoa text input system that the position information previously queried via methods like firstRectForCharacterRange:actualRange: needs to be updated.

keyboardInputSources

The array of keyboard text input source identifier strings available to the receiver. (read-only)

selectedKeyboardInputSource

The identifier string for the selected keyboard text input source.

+ localizedNameForInputSource:

Returns the display name for the given text input source identifier.

Notifications

NSTextInputContextKeyboardSelectionDidChangeNotification

Posted after the selected text input source changes.

Relationships

Inherits From

See Also

Input Management

NSTextInput

A set of methods that text views must implement to interact properly with the text input management system.

NSTextInputClient

A set of methods that text views must implement to interact properly with the text input management system.

NSTextAlternatives

A list of alternative strings for a piece of text.