Speak typed characters in Calculator when echo mode is 'Only in edit controls'.#17905
Merged
Conversation
Contributor
Author
|
cc @josephsl |
Contributor
|
Hi, I think the code works, although it would be best to let others test and offer comments. Thanks. |
seanbudd
reviewed
Apr 6, 2025
seanbudd
approved these changes
Apr 7, 2025
5 tasks
seanbudd
pushed a commit
that referenced
this pull request
Apr 8, 2025
…cho mode is 'Only in edit controls'. (#17913) Addresses #17670 for the classic Windows Calculator. Follow-up to PR #17905. Summary of the issue: Similar to the issue observed in the modern Windows Calculator, the classic Windows Calculator's display area does not consistently trigger character echo when NVDA's "Speak typed characters" setting is configured to 'Only in edit controls'. Description of user facing changes Users will now hear typed characters echoed when typing into the display field of the classic Windows Calculator, even when the "Speak typed characters" option is set to 'Only in edit controls'. Description of development approach This change mirrors the approach taken for the modern Calculator in PR #17905. The event_typedCharacter method within the Display overlay class (which specifically targets the display controls of the classic Calculator in calc.py) is modified. When this event occurs and the original speakTypedCharacters mode is EDIT_CONTROLS, the mode is temporarily switched to ALWAYS before calling the parent class's event handler. The original mode is then restored in a finally block.
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.
Link to issue number:
Fixes #17670
Summary of the issue:
#17505 introduced the functionality where typed characters are only spoken when typing within editable controls. However, the input area in the modern Windows Calculator is not a standard editable control. Furthermore, it appears that almost any focused element within the Calculator can capture user input as part of the mathematical expression.
Description of user facing changes
Users will now hear typed characters in the Calculator even when the "Speak typed characters" option is set to 'Only in edit controls'.
Description of development approach
I handled the
event_typedCharacterevent within the "calculator" app module by temporarily switching thespeakTypedCharactersmode toALWAYSwhen the original setting isEDIT_CONTROLS, thereby ensuring NVDA reports the typed character.As noted above, since it seems almost any focused element in the Calculator accepts user input for the expression, I did not restrict this handling to specific objects within the Calculator.
While this successfully restores the previous behavior, I have some reservations about this approach:
Testing strategy:
Manual testing.
Known issues with pull request:
Code Review Checklist:
@coderabbitai summary