Raxol.Terminal.Input.Manager (Raxol v0.3.0)
View SourceManages input handling for the terminal emulator, including:
- Keyboard input processing
- Mouse event handling
- Input buffering
- Input history
- Input modes
- Special key handling
- Modifier state management
Summary
Functions
Adds the current buffer contents to the input history. Resets the history navigation index and clears the buffer.
Gets the current buffer contents.
Gets the current input mode.
Creates a new input manager with default values.
Processes a key with the current modifier state.
Processes a keyboard input event.
Processes a mouse event.
Processes a special key event.
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
| :f1
| :f2
| :f3
| :f4
| :f5
| :f6
| :f7
| :f8
| :f9
| :f10
| :f11
| :f12
@type t() :: %Raxol.Terminal.Input.Manager{ 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.
Gets the current buffer contents.
@spec get_mode(t()) :: input_mode()
Gets the current input mode.
@spec new() :: t()
Creates a new input manager with default values.
Processes a key with the current modifier state.
Processes a keyboard input event.
@spec process_mouse(t(), mouse_event()) :: t()
Processes a mouse event.
@spec process_special_key(t(), special_key()) :: t()
Processes a special key event.
@spec set_mode(t(), input_mode()) :: t()
Sets the input mode.
Enables or disables mouse event handling.
Updates the modifier state for a key.