Raxol.Terminal.Mouse.MouseServer (Raxol v2.0.1)
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.
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_info/2.
Processes a mouse event from an event map. The event map should contain: button, action, modifiers, x, y
Processes a mouse event.
Sets the active mouse context.
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.
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_info/2.
Processes a mouse event from an event map. The event map should contain: button, action, modifiers, x, y
@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 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.