When announcing calculation result in Win32 calculator rely on name change events#15377
Conversation
|
Thanks, the problem of not being able to read the correct result has been solved, but there is still a problem with this calculator, that is, the plus sign on the numeric keyboard is not prompted, the plus sign (Shift+=) on the main keyboard area and other operation symbols are not affected, I don’t know Could you please fix it by the way? Here is the log: Input: kb(laptop):numLock |
|
The above tests and questions are all test results on Windows 10 21H2 (x86) build 19044.3324 system |
I assume this problem also occurred with 2023.1? |
Opened against beta, since this PR fixes regression from the 2023.2
Link to issue number:
Fixes #15230
Summary of the issue:
NVDA's calculation announcements for Win32 calculator relies on a list of predefined keyboard commands, which, when pressed, causes the new value of the display to be announced. This assumes that at the time when gesture is sent the calculator had enough time to process it, and display the result of the calculation. While this worked before prior to #14708, after this PR NVDA no longer sleeps after sending gestures, therefore the value on calculator's display had not enough time to be updated. For users this means that after performing calculations the outdated value was read.
Description of user facing changes
NVDA once again announces correct results of the calculation.
Description of development approach
Rather than announcing the display value immediately after user pressed a key, NVDA now sets a flag signaling that the given command causes result of a calculation to appear. This flag is checked in the name change event for the display. If it is set the result is announced and the flag is restored to its default value.
While at it I have also updated the copyright header of the module based on its log in VCS.
Testing strategy:
Known issues with pull request:
None known.
Change log entries:
Bug fixes
Code Review Checklist: