Class

NSTextInputContext

An NSTextInputContext object represents the Cocoa text input system. The text input system communicates primarily with the client of the activated input context via the NSTextInputClient protocol.

Symbols

Creating an Input Context

init(client: NSTextInputClient)

The designated initializer

Getting the Input Context and Client

class func current()

Returns the current, activated, text input context object.

var client: NSTextInputClient

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

Configuring the Input Context

var acceptsGlyphInfo: Bool

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

var allowedInputSourceLocales: [String]?

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

Activating the Input Context

func activate()

Activates the receiver.

func deactivate()

Deactivates the receiver.

Handling Input Sources

func handleEvent(NSEvent)

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

func discardMarkedText()

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

func invalidateCharacterCoordinates()

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

var keyboardInputSources: [String]?

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

var selectedKeyboardInputSource: String?

The identifier string for the selected keyboard text input source.

class func localizedName(forInputSource: String)

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

Notifications

static let NSTextInputContextKeyboardSelectionDidChange: NSNotification.Name

Posted after the selected text input source changes.

Relationships

Inherits From

Conforms To