Raxol.Terminal.Input.InputHandler (Raxol v0.2.0)
View SourceHandles input processing for the terminal emulator, including:
- Mouse events (clicks, movement, scrolling)
- Special key handling
- Input mode switching
- Input buffering
- Extended key combinations
- Tab completion
Summary
Functions
Adds the current buffer contents to the input history. Resets the history navigation index and clears the buffer.
Checks if the buffer is empty.
Clears the input buffer.
Gets the contents of the internal input buffer.
Retrieves a specific input from history by its index (0 is most recent). Sets the history_index to track navigation.
Gets the current input mode.
Processes tab completion.
Creates a new input handler with default values.
Moves to the next history entry (newer / Down Arrow).
Moves to the previous history entry (older / Up Arrow). If not currently navigating history, it starts from the most recent entry (index 0).
Processes a key with the current modifier state.
Processes a keyboard input event.
Processes a mouse event.
Processes a special key event.
Sets a completion callback function for tab completion.
Sets the input mode.
Enables or disables mouse event handling.
Updates the modifier state for a key.
Types
@type input_mode() :: :normal | :insert | :replace | :command
@type mouse_button() :: 0 | 1 | 2 | 3 | 4
@type mouse_event() :: {mouse_event_type(), mouse_button(), non_neg_integer(), non_neg_integer()}
@type mouse_event_type() :: :press | :release | :move | :scroll
@type special_key() ::
:up
| :down
| :left
| :right
| :home
| :end
| :page_up
| :page_down
| :insert
| :delete
| :escape
| :tab
| :enter
| :backspace
@type t() :: %Raxol.Terminal.Input.InputHandler{ buffer: Raxol.Terminal.Input.Types.input_buffer(), clipboard_content: String.t() | nil, clipboard_history: [String.t()], completion_callback: completion_callback() | nil, completion_context: map() | nil, completion_index: non_neg_integer(), completion_options: [String.t()], history_index: integer() | nil, input_history: [String.t()], input_queue: [String.t()], last_event_time: integer() | nil, mode: input_mode(), modifier_state: Raxol.Terminal.Input.SpecialKeys.modifier_state(), mouse_buttons: MapSet.t(mouse_button()), mouse_enabled: boolean(), mouse_position: {non_neg_integer(), non_neg_integer()}, processing_escape: boolean(), prompt: String.t() | nil }
Functions
Adds the current buffer contents to the input history. Resets the history navigation index and clears the buffer.
Checks if the buffer is empty.
Clears the input buffer.
Gets the contents of the internal input buffer.
Retrieves a specific input from history by its index (0 is most recent). Sets the history_index to track navigation.
Gets the current input mode.
Processes tab completion.
Creates a new input handler with default values.
Moves to the next history entry (newer / Down Arrow).
Moves to the previous history entry (older / Up Arrow). If not currently navigating history, it starts from the most recent entry (index 0).
Processes a key with the current modifier state.
Processes a keyboard input event.
Processes a mouse event.
Processes a special key event.
Sets a completion callback function for tab completion.
Sets the input mode.
Enables or disables mouse event handling.
Updates the modifier state for a key.