Legacy Mac OS X Reference Library Apple Developer Connection

Legacy Documentclose button

Important: NSInputServiceProvider protocol is deprecated in Mac OS X v10.6 and later. To create input methods, use the Input Method Kit, described in Input Method Kit Framework Reference. For information about text input in Cocoa, see NSTextInputContext Class Reference.


Deprecated NSInputServiceProvider Methods

A method identified as deprecated has been superseded and may become unsupported in the future.

Deprecated in Mac OS X v10.6

activeConversationChanged:toNewConversation:

Keyboard focus just switched from another text view to this one. (required) (Deprecated in Mac OS X v10.6.)

- (void)activeConversationChanged:(id)sender toNewConversation:(NSInteger)newConversation

Discussion

This is called only when switching within the same application. sender can be cast to NSTextInput.

Availability
See Also
Declared In
NSInputServer.h

activeConversationWillChange:fromOldConversation:

Keyboard focus is about to move away from this text view. (required) (Deprecated in Mac OS X v10.6.)

- (void)activeConversationWillChange:(id)sender fromOldConversation:(NSInteger)oldConversation

Discussion

This is called only when switching within the same application. sender can be cast to NSTextInput.

Availability
See Also
Declared In
NSInputServer.h

canBeDisabled

Returns YES if the receiver can be disabled when the sender is not a text view, NO (required) (Deprecated in Mac OS X v10.6.)

- (BOOL)canBeDisabled

Discussion

otherwise.

Availability
Declared In
NSInputServer.h

doCommandBySelector:client:

Handle the command identified by aSelector. (required) (Deprecated in Mac OS X v10.6.)

- (void)doCommandBySelector:(SEL)aSelector client:(id)sender

Discussion

The command can be from the set of NSResponder action methods or from the set of selector values in the DefaultKeyBindings dictionary referenced in the input server’s “Info” file. sender can be cast to NSTextInput.

If you are subclassing NSInputServer, there is no need to override this method in the subclass. All you have to do is implement in the subclass the command methods you want to handle. If you do need to override this method, then you must call super for commands not handled.

If your NSInputServer uses a delegate, the delegate’s implementation of this method must call [sender doCommandBySelector:aSelector] for commands it does not handle.

Availability
See Also
Declared In
NSInputServer.h

inputClientBecomeActive:

The client, sender, has become active. (required) (Deprecated in Mac OS X v10.6.)

- (void)inputClientBecomeActive:(id)sender

Discussion

This is called when the client application starts up and whenever it becomes active after being inactive. sender can be cast to NSTextInput.

Availability
See Also
Declared In
NSInputServer.h

inputClientDisabled:

A text view in the client, sender, has ceased to be the key-receiving first responder. (required) (Deprecated in Mac OS X v10.6.)

- (void)inputClientDisabled:(id)sender

Discussion

inputClientResignActive: may also be called just after this is called. sender can be cast to NSTextInput.

Availability
See Also
Declared In
NSInputServer.h

inputClientEnabled:

A text view in the client, sender, has become the key-receiving first responder. (required) (Deprecated in Mac OS X v10.6.)

- (void)inputClientEnabled:(id)sender

Discussion

This is called the first time any text view becomes enabled after client application activation and again whenever focus switches to a text view. inputClientBecomeActive: may have been called just before this is called. sender can be cast to NSTextInput.

Availability
See Also
Declared In
NSInputServer.h

inputClientResignActive:

The client, sender, is about to become inactive. (required) (Deprecated in Mac OS X v10.6.)

- (void)inputClientResignActive:(id)sender

Discussion

This is called when the client application quits and whenever it is deactivated. sender can be cast to NSTextInput.

Availability
See Also
Declared In
NSInputServer.h

insertText:client:

Interpret the characters in aString, which is actually always an NSString. (required) (Deprecated in Mac OS X v10.6.)

- (void)insertText:(id)aString client:(id)sender

Discussion

Here is where you do the interpreting of keyboard input. If your server’s interpretation is disabled or the characters in aString are not of interest to the server, you can simply pass aString along to the sender’s insertText: method. sender can be cast to NSTextInput.

Availability
See Also
Declared In
NSInputServer.h

markedTextAbandoned:

Abandon any marked text state that may be in process. (required) (Deprecated in Mac OS X v10.6.)

- (void)markedTextAbandoned:(id)sender

Discussion

This can happen if the user clicks the mouse outside of the marked text area or if the window containing the text view closes. The client can do what it wants with the marked text. NSTextView leaves it as inserted text. sender can be cast to NSTextInput.

Availability
See Also
Declared In
NSInputServer.h

markedTextSelectionChanged:client:

(Deprecated in Mac OS X v10.6.)

- (void)markedTextSelectionChanged:(NSRange)newSelection client:(id)sender

Discussion

The user selected a portion of the marked text or clicked at the beginning or end of marked text or somewhere in between. sender can be cast to NSTextInput.

Availability
See Also
Declared In
NSInputServer.h

terminate:

The client application is quitting. (required) (Deprecated in Mac OS X v10.6.)

- (void)terminate:(id)sender

Discussion

This is called after inputClientResignActive:. sender can be cast to NSTextInput.

Availability
See Also
Declared In
NSInputServer.h

wantsToDelayTextChangeNotifications

A YES return value tells the client that only a call to its insertText:client: method constitutes a modification to its text storage. (required) (Deprecated in Mac OS X v10.6.)

- (BOOL)wantsToDelayTextChangeNotifications

Discussion

A NO return value tells the client that all text given to it, whether marked text or not, should constitute a modification to its text storage. A YES return value tells the client that only unmarked text given to it should constitute a modification to its text storage. The client may for example want to filter all text that is part of a modification but leave marked text unfiltered.

Availability
See Also
Declared In
NSInputServer.h

wantsToHandleMouseEvents

Returns YES if the client should forward all mouse events within the text view to the input server. (required) (Deprecated in Mac OS X v10.6.)

- (BOOL)wantsToHandleMouseEvents

Discussion

If the server needs to implement the NSInputServerMouseTracker protocol, return YES.

Availability
See Also
Declared In
NSInputServer.h

wantsToInterpretAllKeystrokes

Returns YES if the server wants all keystrokes to be sent to it as characters. (required) (Deprecated in Mac OS X v10.6.)

- (BOOL)wantsToInterpretAllKeystrokes

Discussion

If this method returns NO, control key combinations and function keys (the arrow keys, PageDown, F5, and so on) are delivered to the input server via the key binding mechanism and doCommandBySelector:client:.

The Unicode values for the characters representing keyboard function keys (the arrow keys, PageDown, F5, and so on) names like NSUpArrowFunctionKey, and are documented in NSEvent. Control-key combinations are the usual ASCII control character codes.

For more information on key bindings, see “About Key Bindings”.

Availability
See Also
Declared In
NSInputServer.h


Last updated: 2008-10-20

Did this document help you? Yes It's good, but... Not helpful...