Add optional screen-reader accessibility (speech) support#391
Open
dannyboy1996 wants to merge 1 commit into
Open
Add optional screen-reader accessibility (speech) support#391dannyboy1996 wants to merge 1 commit into
dannyboy1996 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title:
Add optional screen-reader accessibility (speech) support
Summary
This adds optional speech output for blind / low-vision users on Windows. When a
screen reader (NVDA, JAWS, System Access, SuperNova, Window-Eyes, ZoomText) is
running, the emulator detects it at startup and speaks the X16's text-screen
output. When no screen reader is present, the emulator behaves exactly as before
(silent) -- there is no change for sighted users and no robot-voice/SAPI
fallback.
The feature is self-contained: it lives almost entirely in a new src/speech.c /
src/speech.h module, with small taps in main.c and video.c. It compiles and runs
unchanged on all platforms; on non-Windows builds the speech module is a set of
no-op stubs.
What it does
Output speech: characters sent to KERNAL CHROUT ($FFD2) are collected and
spoken as a block once output goes briefly quiet (~150 ms). This covers the
BASIC prompt, LIST, PRINT, and other text-mode output, and avoids individual
lines interrupting one another.
Key echo: each typed key is spoken as it is pressed.
Edit navigation: Left/Right arrows speak the character moved onto, and
Backspace speaks the character deleted. These are read from the VERA text
layer at the KERNAL cursor position (RAM $0380/$0383), so they reflect what is
actually on screen.
History review: every printed line is kept in a scrollback ring. Ctrl+Up /
Ctrl+Down step through it line by line; Ctrl+Home / Ctrl+End jump to the
oldest / newest line; Ctrl+Shift+Up repeats the current line. These keys are
consumed on the host and never reach the X16.
How speech is produced
Speech goes through the Tolk library (https://github.com/dkager/tolk, LGPLv3),
which abstracts the various Windows screen readers. Tolk.dll is loaded
DYNAMICALLY at runtime:
stays off and the emulator runs normally. There is no build-time or link-time
dependency on Tolk.
when a real screen reader is active.
Command-line options
(Speech requires no flag to enable -- it is automatic when a reader is detected.)
Files changed
Open question for maintainers
The source has no hard dependency on Tolk, but for the feature to work for end
users, Tolk.dll (and its nvdaControllerClient64.dll helper) must sit next to the
executable. Options I'm happy to implement based on your preference:
Windows build output.
Tolk is LGPLv3, so redistribution alongside the emulator is fine with
attribution.
Testing
Built with MinGW-w64 (GCC 15.2) + SDL2 2.32 + zlib 1.3.1 on Windows 11.
Verified with NVDA running:
reads the deleted character.