Raxol.Core.Accessibility.FocusManager (Raxol Core v2.4.0)

Copy Markdown View Source

Pure-functional helpers for focus tracking, announcements, and event handler registration within the AccessibilityServer state.

Summary

Functions

Creates a focus announcement string from element metadata, or nil.

Returns the focus history stored in metadata.

Handles a focus change by looking up the new focus element's metadata and potentially enqueuing a focus announcement.

Registers accessibility event handlers with EventManager for the given server module.

Unregisters accessibility event handlers from EventManager for the given server module.

Functions

create_focus_announcement(metadata)

Creates a focus announcement string from element metadata, or nil.

get_focus_history(state)

Returns the focus history stored in metadata.

handle_focus_announcement(state, new_focus)

Handles a focus change by looking up the new focus element's metadata and potentially enqueuing a focus announcement.

Returns {:noreply, new_state}.

register_event_handlers(server_module)

Registers accessibility event handlers with EventManager for the given server module.

unregister_event_handlers(server_module)

Unregisters accessibility event handlers from EventManager for the given server module.