ui_access

module ui_accesssource

Screen readers for pkg::alloy::ui (REFOCUS.md, R6f, question 3B): an app installs them, and from then on the platform's screen readers see it, through the tree its widgets describe (Widget::semantics).

import pkg::alloy::ui;
import pkg::alloy::ui_access as ui_access;

fn main() -> i32 {
    return app(&WindowConfig::titled(&"Counter"), (ui) => {
        ui_access::install(&var ui);
        const count = ui.signal(0);
        return ui.add(Button::text(&"Add one", (ui) => count.update(&var ui, (n) => n += 1)));
    });
}

Installing lets the window's screen readers reach it (pkg::alloy::window's install_access: AT-SPI on Linux, UI Automation on Windows, NSAccessibility on macOS, the page's accessibility layer behind its "Turn on accessibility" button); once one asks, each frame drawn sends the window the nodes changed (access.alloy), fields and texts of several lines with the maps screen readers read them by (text_maps.alloy), and what screen readers ask comes back as the elements' input. An app not installing them links none of it, and screen readers find only a window.

## How it was built

Notes kept from each stage as it was finished, the sizes and numbers of their day; what changed since is in REVIEW.md and the history.

**R6f as built** (2026-10-26; REFOCUS.md, question 3B): screen readers opt in, moved out of ui.

**F6a as built** (2026-10-13), the part ui_access holds since R6f (the rest in pkg::alloy::window's notes):

**F14b as built** (2026-10-20; decisions/F14.md, "Text for screen readers"), the part ui_access holds since R6f (the rest in pkg::alloy::ui's and pkg::alloy::window's notes):

fn installsource

exp fn install(ui: &var Ui)

Lets the platform's screen readers see the app, from now on.