Skip to main content

Module screen_reader

Module screen_reader 

Expand description

Built-in screen reader.

Narrates the semantic tree (crate::a11y::AccessNode) through an offline TTS stack. Focus changes interrupt the previous utterance; everything funnels through one [SpeechQueue], so a focus storm coalesces to the latest utterance instead of backing up.

describe is the pure core (AccessNode -> String, no I/O) — exhaustively unit-tested below as a role x state truth table.

A reading cursor can also walk the flattened accessible tree (DFS, presentational nodes collapsed) via ScreenReader::read_all / read_next / read_prev.

Narration vocabulary resolves through i18n! bundles; with none loaded it falls back to English so headless builds narrate unchanged.

Structs§

ScreenReader

Functions§

describe
Compose the spoken phrase for an accessible node — the pure, heavily unit-tested core of the screen reader.
describe_state
Value + state, without name or role — confirms the result of activating or adjusting a control (e.g. “checked”) without re-reading the whole label.
flatten_reading_order
DFS, collapsing presentational widgets (accessibility() == None) exactly as crate::accesskit_bridge::build_tree_update does.
is_form_field
Deliberately covers the editable + actionable controls (buttons, toggles, inputs, ranges, selectors) but not structural containers or static content.
is_heading