Raxol.Terminal.Mouse.UnifiedMouse (Raxol v0.5.0)
View SourceProvides unified mouse handling functionality for the terminal emulator. This module handles mouse events, tracking, and state management.
Summary
Functions
Returns a specification to start this module under a supervisor.
Cleans up resources.
Closes a mouse context.
Creates a new mouse context with the given configuration.
Gets the active mouse context ID.
Gets the list of all mouse contexts.
Gets the current mouse button state.
Gets the current mouse position.
Gets the state of a specific mouse context.
Processes a mouse event.
Sets the active mouse context.
Starts the mouse manager with the given options.
Updates the mouse manager configuration.
Updates the configuration of a specific mouse context.
Types
@type mouse_button() :: :left | :middle | :right | :wheel_up | :wheel_down
@type mouse_event() :: :press | :release | :move | :drag | :click | :double_click
@type mouse_id() :: non_neg_integer()
@type mouse_modifier() :: :shift | :ctrl | :alt | :meta
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec cleanup() :: :ok
Cleans up resources.
Closes a mouse context.
Creates a new mouse context with the given configuration.
@spec get_active_mouse() :: {:ok, mouse_id()} | {:error, :no_active_mouse}
Gets the active mouse context ID.
@spec get_mice() :: [mouse_id()]
Gets the list of all mouse contexts.
@spec get_mouse_button_state(mouse_id()) :: {:ok, [mouse_button()]} | {:error, term()}
Gets the current mouse button state.
Gets the current mouse position.
Gets the state of a specific mouse context.
@spec process_mouse_event( mouse_id(), mouse_event(), mouse_button(), {integer(), integer()}, [mouse_modifier()] ) :: :ok | {:error, term()}
Processes a mouse event.
Sets the active mouse context.
@spec start_link(map()) :: GenServer.on_start()
Starts the mouse manager with the given options.
@spec update_config(map()) :: :ok
Updates the mouse manager configuration.
@spec update_mouse_config(mouse_id(), mouse_config()) :: :ok | {:error, term()}
Updates the configuration of a specific mouse context.