Raxol.Terminal.Events (Raxol v2.0.1)
View SourceGlobal event management for terminal interactions.
This module provides a centralized event system for handling global terminal events such as clicks, keyboard input, and other user interactions that need to be processed at the application level.
Summary
Functions
Returns a specification to start this module under a supervisor.
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_info/2.
Registers a global click handler that will be called whenever a click occurs.
Triggers a click event at the given position.
Unregisters a previously registered click handler.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_info/2.
Registers a global click handler that will be called whenever a click occurs.
Parameters
handler- A function that takes a click position and handles the event
Examples
Raxol.Terminal.Events.register_global_click(fn {x, y} ->
Log.info("Clicked at #{x}, #{y}")
end)
Triggers a click event at the given position.
This will call all registered click handlers.
@spec unregister_global_click(reference()) :: :ok
Unregisters a previously registered click handler.
Parameters
ref- The reference returned from register_global_click