Raxol.Terminal.Input (Raxol v2.0.1)

View Source

Handles input processing for the terminal.

Summary

Functions

Clears completion state. Should be called when input changes other than tab completion.

Example completion callback that provides Elixir keywords.

Handles a mouse click event.

Handles a mouse drag event.

Handles a mouse release event.

Creates a new input handler.

Performs tab completion on the input buffer. Uses the completion_callback to find matches and cycles through them.

Types

completion_callback()

@type completion_callback() :: (String.t() -> [String.t()])

t()

@type t() :: %Raxol.Terminal.Input{
  buffer: list(),
  completion_callback: completion_callback() | nil,
  completion_index: non_neg_integer(),
  completion_options: [String.t()],
  last_click: {integer(), integer(), atom()} | nil,
  last_drag: {integer(), integer(), atom()} | nil,
  last_release: {integer(), integer(), atom()} | nil,
  state: atom()
}

Functions

clear_completion(input)

Clears completion state. Should be called when input changes other than tab completion.

example_completion_callback(prefix)

Example completion callback that provides Elixir keywords.

handle_click(input, x, y, button)

Handles a mouse click event.

handle_drag(input, x, y, button)

Handles a mouse drag event.

handle_release(input, x, y, button)

Handles a mouse release event.

new()

Creates a new input handler.

tab_complete(input)

Performs tab completion on the input buffer. Uses the completion_callback to find matches and cycles through them.