Class KeyMap<T>

java.lang.Object
org.jline.keymap.KeyMap<T>
Type Parameters:
T - the type of objects to which key sequences are bound

public class KeyMap<T> extends Object
The KeyMap class maps keyboard input sequences to operations or actions.

KeyMap is a core component of JLine's input handling system, providing the ability to bind specific key sequences (like Ctrl+A, Alt+F, or multi-key sequences) to arbitrary operations represented by objects of type T.

Key features include:

  • Support for single-key and multi-key sequences
  • Special handling for Unicode characters not explicitly bound
  • Timeout handling for ambiguous bindings (e.g., Escape key vs. Alt combinations)
  • Utility methods for creating common key sequences (Ctrl, Alt, etc.)

This class is used extensively by the LineReader to implement customizable key bindings for line editing operations.

Since:
2.6