Raxol.Terminal.Input.Manager (Raxol v0.5.0)

View Source

Manages terminal input operations with advanced features:

  • Advanced key handling with modifier support
  • Input validation and sanitization
  • Input buffering with timeout handling
  • Input customization and mapping

Summary

Functions

Flushes the input buffer.

Gets the current input metrics.

Creates a new input manager with the given options.

Processes a key event with validation and mapping.

Types

key_event()

@type key_event() :: %{
  key: String.t(),
  modifiers: [key_modifier()],
  timestamp: integer()
}

key_modifier()

@type key_modifier() :: :shift | :ctrl | :alt | :meta

t()

@type t() :: %Raxol.Terminal.Input.Manager{
  buffer: Raxol.Terminal.Input.Buffer.t(),
  metrics: %{
    processed_events: integer(),
    validation_failures: integer(),
    buffer_overflows: integer()
  },
  processor: Raxol.Terminal.Input.Processor.t()
}

Functions

flush_buffer(manager)

@spec flush_buffer(t()) :: t()

Flushes the input buffer.

get_metrics(manager)

@spec get_metrics(t()) :: map()

Gets the current input metrics.

new(opts \\ [])

@spec new(keyword()) :: t()

Creates a new input manager with the given options.

process_key_event(manager, event)

@spec process_key_event(t(), key_event()) :: {:ok, t()} | {:error, term()}

Processes a key event with validation and mapping.