Which approach should an SDL application use to make a custom-drawn UI accessible to screen readers?
20.5K reputation · 08 Feb 2020, 11:52 UTC
Our application renders its entire user interface through SDL (Simple DirectMedia Layer), drawing menus and dialogs onto a single window surface. We now need this workflow to be usable with screen readers such as NVDA and VoiceOver, not just with keyboard-only input.
From what I understand, SDL is a low-level windowing and input layer: it delivers keyboard events and offers SDL_StartTextInput for IME-aware text entry, but it does not populate the platform accessibility tree (UIA, AT-SPI, NSAccessibility) for custom-rendered content. That leaves the window effectively opaque to assistive technology unless the application adds something itself. I also could not find a documented cross-platform SDL API for announcing dynamic content changes, such as live-region-style updates when a dialog opens.
We are targeting SDL2 today, with SDL3 migration under consideration, so version differences in text input handling matter to us.
Is building per-platform accessibility bridges the accepted approach, or is embedding an accessible UI toolkit alongside SDL more practical in real projects? Does the answer change between SDL2 and SDL3? And is there any documented pattern for announcing dynamic content changes to screen readers from an SDL-rendered UI?