<!--
{
  "documentType" : "article",
  "framework" : "InputMethodKit",
  "identifier" : "/documentation/InputMethodKit/imkserverinput",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "IMKServerInput"
}
-->

# IMKServerInput

`IMKServerInput` is an informal protocol that defines methods for receiving text events. This is intentionally not a formal protocol because there are three ways to receive events. An input method chooses one of the following approaches and implements the appropriate methods:

## Discussion

- Key binding. In this approach the system tries to map each key-down event to an action method that the input method has implemented.  If successful (action method found), the system calls `didCommandBySelector:client:`.  If unsuccessful (action method not found), the system calls `inputText:client:`.  For this approach you need to implement <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/inputText(_:client:)> and <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/didCommand(by:client:)>.
- Text data only. In this approach, you opt to receive all key events without the key binding, and then unpack  the relevant text data.   Key events are broken down into the Unicodes, the key code that generated them, and modifier flags.  This data is then sent to the <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/inputText(_:key:modifiers:client:)> method, which you need to implement.
- Handle all events. In this approach, you receive events directly from the Text Services Manager as <doc://com.apple.documentation/documentation/AppKit/NSEvent> objects. You must implement <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/handle(_:client:)> method.

## Topics

### Supporting Key Binding

  <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/inputText(_:client:)>

  <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/didCommand(by:client:)>

### Unpacking Text Data

  <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/inputText(_:key:modifiers:client:)>

### Receiving Events Directly from the Text Services Manager

  <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/handle(_:client:)>

### Committing a Composition

  <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/commitComposition(_:)>

### Getting Input Strings and Candidates

  <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/composedString(_:)>

  <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/originalString(_:)>

  <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/candidates(_:)>

### Constants

[Info Dictionary Keys](/documentation/InputMethodKit/info-dictionary-keys)

Constants for keys used to look up information in the info dictionary.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)