---
title: IMKServerInput
framework: InputMethodKit
role: collectionGroup
path: inputmethodkit/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:

## Overview

Overview 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 inputText(_:client:) and 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 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 NSEvent objects. You must implement handle(_:client:) method.

## Topics

### Supporting Key Binding

- [inputText(_:client:)](objectivec/nsobject-swift.class/inputtext(_:client:).md)
- [didCommand(by:client:)](objectivec/nsobject-swift.class/didcommand(by:client:).md)

### Unpacking Text Data

- [inputText(_:key:modifiers:client:)](objectivec/nsobject-swift.class/inputtext(_:key:modifiers:client:).md)

### Receiving Events Directly from the Text Services Manager

- [handle(_:client:)](objectivec/nsobject-swift.class/handle(_:client:).md)

### Committing a Composition

- [commitComposition(_:)](objectivec/nsobject-swift.class/commitcomposition(_:).md)

### Getting Input Strings and Candidates

- [composedString(_:)](objectivec/nsobject-swift.class/composedstring(_:).md)
- [originalString(_:)](objectivec/nsobject-swift.class/originalstring(_:).md)
- [candidates(_:)](objectivec/nsobject-swift.class/candidates(_:).md)

### Constants

- [Info Dictionary Keys](inputmethodkit/info-dictionary-keys.md)

## See Also

### Protocols

- [IMKMouseHandling](inputmethodkit/imkmousehandling.md)
- [IMKStateSetting](inputmethodkit/imkstatesetting.md)
