Text Input
NSTextView uses helper objects called input managers to interpret user input and turn it into text or commands. NSTextView passes raw character input to an input manager. The input manager determines what the raw input means and sends messages to the NSTextView. If the input consists of characters to be inserted, the input manager sends an -insertText: message with the text to insert. If the input consists of commands such as cursor movement keys, the Enter key, or the Backspace key, the input manager sends a -doCommandBySelector: message with an appropriate selector as the argument. The selector specifies the action that the text view should take such as -moveDown:, -deleteBackward:, or -insertNewline:. The set of actions that input ...
Get Cocoa® Programming now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.