Skip to content

When announcing calculation result in Win32 calculator rely on name change events#15377

Merged
seanbudd merged 3 commits into
nvaccess:betafrom
lukaszgo1:I15230
Sep 6, 2023
Merged

When announcing calculation result in Win32 calculator rely on name change events#15377
seanbudd merged 3 commits into
nvaccess:betafrom
lukaszgo1:I15230

Conversation

@lukaszgo1

@lukaszgo1 lukaszgo1 commented Sep 5, 2023

Copy link
Copy Markdown
Contributor

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:

  • Ensured that correct result are again announced, with both keyboard echo, and announcement of command keys enabled and disabled.
  • Got confirmation from reporters running Windows 8.1 and Windows 10 21H2 (x86) build 19044.3324 that the issue is fixed for them.

Known issues with pull request:

None known.

Change log entries:

Bug fixes

  • NVDA once again announces calculation results in the calculator on Server, LTSC and LTSB versions of Windows.

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • Security precautions taken.

@lukaszgo1 lukaszgo1 closed this Sep 5, 2023
@lukaszgo1 lukaszgo1 reopened this Sep 5, 2023
@lukaszgo1 lukaszgo1 changed the base branch from master to beta September 5, 2023 20:04
@seanbudd seanbudd added this to the 2023.3 milestone Sep 6, 2023
@wmhn1872265132

Copy link
Copy Markdown
Contributor

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
IO - speech.speech.speak (09:01:06.553) - MainThread (8204):
Speaking ['数字 开']
IO - inputCore.InputManager.executeGesture (09:01:07.313) - winInputHook (2144):
Input: kb(laptop):numLockNumpad5
IO - speech.speech.speak (09:01:07.373) - MainThread (8204):
Speaking ['5', EndUtteranceCommand()]
IO - inputCore.InputManager.executeGesture (09:01:07.809) - winInputHook (2144):
Input: kb(laptop):numLock+numpadPlus
IO - inputCore.InputManager.executeGesture (09:01:08.888) - winInputHook (2144):
Input: kb(laptop):numLockNumpad7
IO - speech.speech.speak (09:01:08.908) - MainThread (8204):
Speaking ['7', EndUtteranceCommand()]
IO - inputCore.InputManager.executeGesture (09:01:09.262) - winInputHook (2144):
Input: kb(laptop):numpadEnter
IO - speech.speech.speak (09:01:09.303) - MainThread (8204):
Speaking ['12 ']
IO - inputCore.InputManager.executeGesture (09:01:10.784) - winInputHook (2144):
Input: kb(laptop):escape
IO - speech.speech.speak (09:01:10.823) - MainThread (8204):
Speaking ['0 ']
IO - inputCore.InputManager.executeGesture (09:01:12.687) - winInputHook (2144):
Input: kb(laptop):numLockNumpad5
IO - speech.speech.speak (09:01:12.711) - MainThread (8204):
Speaking ['5', EndUtteranceCommand()]
IO - inputCore.InputManager.executeGesture (09:01:13.553) - winInputHook (2144):
Input: kb(laptop):shift+=
IO - speech.speech.speakTypedCharacters (09:01:13.588) - MainThread (8204):
typed word: 575
IO - speech.speech.speak (09:01:13.588) - MainThread (8204):
Speaking ['加', EndUtteranceCommand()]
IO - inputCore.InputManager.executeGesture (09:01:14.450) - winInputHook (2144):
Input: kb(laptop):numLockNumpad7
IO - speech.speech.speak (09:01:14.474) - MainThread (8204):
Speaking ['7', EndUtteranceCommand()]
IO - inputCore.InputManager.executeGesture (09:01:14.855) - winInputHook (2144):
Input: kb(laptop):numpadEnter
IO - speech.speech.speak (09:01:14.895) - MainThread (8204):
Speaking ['12 ']

@wmhn1872265132

Copy link
Copy Markdown
Contributor

The above tests and questions are all test results on Windows 10 21H2 (x86) build 19044.3324 system

@lukaszgo1 lukaszgo1 marked this pull request as ready for review September 6, 2023 09:51
@lukaszgo1 lukaszgo1 requested a review from a team as a code owner September 6, 2023 09:51
@lukaszgo1 lukaszgo1 requested review from seanbudd and removed request for a team September 6, 2023 09:51
@lukaszgo1

lukaszgo1 commented Sep 6, 2023

Copy link
Copy Markdown
Contributor Author

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?

I assume this problem also occurred with 2023.1?
If so this is out of scope of this PR.
This problem is already reported in #3430 - please subscribe to that issue for updates.

@seanbudd seanbudd merged commit f7049fd into nvaccess:beta Sep 6, 2023
@lukaszgo1 lukaszgo1 deleted the I15230 branch September 7, 2023 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NVDA 2023.2 beta 1 is not correctly reading the display on the win32 calculator

3 participants