nvda
d0b0cb90 - Added an option to automatically read the entire result after a successful recognition (#19150)

Commit
73 days ago
Added an option to automatically read the entire result after a successful recognition (#19150) Resolves #19144 ### Summary of the issue: After performing an OCR, users must manually initiate a "say all" command to hear the full recognition result. For users who frequently perform OCR on large blocks of text, this requires an extra step each time, slowing down their workflow. ### Description of user facing changes: - Adds a new checkbox, "Automatically say all on result", to the Windows OCR settings panel (under Preferences -> Windows OCR). - When enabled, NVDA will automatically start reading the full text of a successful OCR result. - This feature is disabled by default. ### Description of developer facing changes: - Adds a new configuration key `autoSayAllOnResult` (boolean, default `False`) under the `[uwpOcr]` section in `configSpec.py`. ### Description of development approach: To ensure "say all" is triggered only after the recognition result document has focus, a flag (`_shouldSayAllOnFirstFocus`) is set when the result is first received in `_onFirstResult`. The actual `sayAll` command (`sayAll.SayAllHandler.readText(sayAll.CURSOR.CARET)`) is then called from the `event_gainFocus` handler of the `RefreshableRecogResultNVDAObject`. ### Testing strategy: Manually tested by: 1. Enabling the "Automatically say all on result" option in the Windows OCR settings. 2. Performing OCR on a navigator object (`NVDA+r`). Verified that "say all" begins automatically. 3. Disabling the option and performing OCR again. Verified that "say all" does not start, and only the document title is announced. 4. Confirmed the setting persists after restarting NVDA. ### Known issues with pull request: The options in Windows OCR do not appear to follow profile switching, which seems to be a general issue and not specific to this change.
Author
Parents
Loading