Raxol. Core. Runtime. Events. DispatcherHooks
(Raxol v2.6.0)
View Source
Pure-function hooks extracted from Dispatcher for mouse hit testing, time-travel debugging, cycle profiling, and session recording.
None of these functions depend on GenServer state -- they operate on explicit arguments and return values.
Summary
Functions
Checks whether a single positioned element is clickable at (x, y).
Walk positioned elements (last drawn = topmost) looking for a clickable element whose bounding box contains (x, y).
Converts a key event data map to a printable string for session recording.
Records a cycle profiler update when the profiler PID is active. No-ops when disabled (nil or non-pid).
Records key input events to the session recorder when it is running.
Only records :key type events; all others are ignored.
Records a time-travel snapshot when the time-travel debugger PID is active. No-ops when disabled (nil or non-pid).
Times the execution of fun when cycle profiling is enabled.
Returns {elapsed_us, mem_before, mem_after, result}.
When disabled (nil profiler), returns {0, 0, 0, result}.
Functions
Checks whether a single positioned element is clickable at (x, y).
Returns {:click, handler} when hit, nil when missed.
Walk positioned elements (last drawn = topmost) looking for a clickable element whose bounding box contains (x, y).
Returns {:click, handler} or :miss.
Converts a key event data map to a printable string for session recording.
@spec maybe_record_cycle_update( pid() | nil, non_neg_integer(), non_neg_integer(), non_neg_integer(), term() ) :: :ok
Records a cycle profiler update when the profiler PID is active. No-ops when disabled (nil or non-pid).
@spec maybe_record_input(Raxol.Core.Events.Event.t() | term()) :: :ok
Records key input events to the session recorder when it is running.
Only records :key type events; all others are ignored.
Records a time-travel snapshot when the time-travel debugger PID is active. No-ops when disabled (nil or non-pid).
@spec maybe_time_update(pid() | nil, (-> term())) :: {non_neg_integer(), non_neg_integer(), non_neg_integer(), term()}
Times the execution of fun when cycle profiling is enabled.
Returns {elapsed_us, mem_before, mem_after, result}.
When disabled (nil profiler), returns {0, 0, 0, result}.