Raxol.Terminal.Input.Manager (Raxol Terminal v2.6.0)

Copy Markdown View Source

Manages terminal input processing including character input, key events, and input mode handling. This module is responsible for processing all input events and converting them into appropriate terminal actions.

Summary

Functions

Adds a custom key mapping.

Adds a custom validation rule.

Flushes the input buffer.

Gets the buffer contents.

Gets the current input mode. Returns the input mode.

Gets the current metrics.

Gets the current mode.

Handles a key event. Returns the updated emulator and any output.

Creates a new input manager with default configuration.

Creates a new input manager with custom options.

Processes a single character input. Returns the updated emulator and any output.

Processes a sequence of character inputs. Returns the updated emulator and any output.

Processes a key event.

Processes a key with modifiers.

Processes keyboard input.

Processes mouse events.

Processes special keys.

Sets the input mode. Returns the updated emulator.

Sets the mode.

Sets mouse enabled state.

Types

t()

@type t() :: %Raxol.Terminal.Input.Manager{
  buffer: map(),
  completion_callback: function() | nil,
  history_index: integer() | nil,
  input_history: list(),
  key_mappings: map(),
  metrics: map(),
  mode: atom(),
  modifier_state: map(),
  mouse_buttons: MapSet.t(),
  mouse_enabled: boolean(),
  mouse_position: {integer(), integer()},
  processor: module(),
  validation_rules: list()
}

Functions

add_key_mapping(manager, from_key, to_key)

Adds a custom key mapping.

add_validation_rule(manager, rule)

Adds a custom validation rule.

flush_buffer(manager)

Flushes the input buffer.

get_buffer_contents(manager)

Gets the buffer contents.

get_input_mode(emulator)

Gets the current input mode. Returns the input mode.

get_metrics(manager)

Gets the current metrics.

get_mode(manager)

Gets the current mode.

handle_key_event(emulator, atom, event)

Handles a key event. Returns the updated emulator and any output.

new()

Creates a new input manager with default configuration.

new(opts)

Creates a new input manager with custom options.

process_input(emulator, char)

Processes a single character input. Returns the updated emulator and any output.

process_input_sequence(emulator, chars)

Processes a sequence of character inputs. Returns the updated emulator and any output.

process_key_event(manager, event)

Processes a key event.

process_key_with_modifiers(manager, key)

Processes a key with modifiers.

process_keyboard(manager, key)

Processes keyboard input.

process_mouse(manager, arg)

Processes mouse events.

process_special_key(manager, key)

Processes special keys.

set_input_mode(emulator, mode)

Sets the input mode. Returns the updated emulator.

set_mode(manager, mode)

Sets the mode.

set_mouse_enabled(manager, enabled)

Sets mouse enabled state.

update_modifier(manager, modifier, value)

Updates modifier state.