Important:
NSInputManager is deprecated in Mac OS X v10.6 and later. Its replacement is NSTextInputContext class, described in NSTextInputContext Class Reference. To create input methods, use the Input Method Kit, described in Input Method Kit Framework Reference.
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in Mac OS X v10.0 and later. |
| Companion guide | |
| Declared in | NSInputManager.h |
Important: NSInputManager is deprecated in Mac OS X v10.6 and later. Its replacement is NSTextInputContext class, described in NSTextInputContext Class Reference. To create input methods, use the Input Method Kit, described in Input Method Kit Framework Reference.
NSInputManager is one of the three players in the Cocoa text input management system. The input manager acts as a proxy between "NSInputServer" and text views. You never have to instantiate or subclass NSInputManager, and unless you are implementing a text view that does not inherit from NSTextView, you never have to directly access its methods either.
If an application needs more complex text handling than the standard Cocoa text view classes can provide, then it will use its own text view class that implements the NSTextInput protocol, and that class will call NSInputManager’s methods. The current input manager’s input server will call some of the text view’s NSTextInput protocol methods.
The wantsToDelayTextChangeNotifications, wantsToHandleMouseEvents, and wantsToInterpretAllKeystrokes methods call methods of the same names on the input manager’s current input server and return the result.
– characterIndexForPoint:
– conversationIdentifier
– doCommandBySelector:
– firstRectForCharacterRange:
– hasMarkedText
– insertText:
– markedRange
– selectedRange
– setMarkedText:selectedRange:
– unmarkText
– validAttributesForMarkedText
– initWithName:host: Deprecated in Mac OS X v10.6
– markedTextAbandoned:
– markedTextSelectionChanged:client:
– wantsToHandleMouseEvents
– handleMouseEvent:
– wantsToDelayTextChangeNotifications Deprecated in Mac OS X v10.6
– wantsToInterpretAllKeystrokes Deprecated in Mac OS X v10.6
– image Deprecated in Mac OS X v10.6
– language Deprecated in Mac OS X v10.6
– localizedInputManagerName Deprecated in Mac OS X v10.6
– server Deprecated in Mac OS X v10.6
The current input manager is the one that has been chosen to handle keyboard events at the time this method is called.
+ (NSInputManager *)currentInputManager
Don’t cache the return value, because the user can switch to a different input manager at any time.
NSInputManager.hDeprecated.
+ (void)cycleToNextInputLanguage:(id)sender
NSInputManager.hDeprecated.
+ (void)cycleToNextInputServerInLanguage:(id)sender
NSInputManager.h- (BOOL)handleMouseEvent:(NSEvent *)theMouseEvent
Forwards a mouse event passed in theMouseEvent to the input server. If wantsToHandleMouseEvents returns YES, then the text view must forward all mouse events that occur within it. As usual, a return value of NO means that the text view should proceed with handling the event.
For additional information see the NSInputServerMouseTracker class.
NSInputManager.hThe input server must abandon whatever it was doing with marked text.
- (void)markedTextAbandoned:(id)client
The NSTextView object client calls this when the user clicks outside the marked text (anywhere other than the beginning of marked text, the end of marked text, or in between), then NSTextView promotes the marked text to normal text as if it had been inserted. A custom text view is free to choose not to keep the marked text.
– markedTextSelectionChanged:client:– markedTextAbandoned: (NSInputServiceProvider)NSInputManager.hThe user clicked at the beginning of marked text, the end of marked text, or in between, or the user made a selection within the marked text in the client text view.
- (void)markedTextSelectionChanged:(NSRange)newSel client:(id)client
The range newSel is relative to the beginning of the marked text.
– markedTextAbandoned:– markedTextSelectionChanged:client: (NSInputServiceProvider)NSInputManager.hReturns YES if the sender should forward all mouse events within the text view to the input server.
- (BOOL)wantsToHandleMouseEvents
– wantsToHandleMouseEvents (NSInputServiceProvider)NSInputManager.h
Last updated: 2008-10-21