Skip to content

Windows 11 modern keyboard: respond to UIA notification event (voice typing and suggested actions)#16014

Merged
seanbudd merged 6 commits into
nvaccess:masterfrom
josephsl:i16009win11ModernKeyboardUIANotification
Jan 8, 2024
Merged

Windows 11 modern keyboard: respond to UIA notification event (voice typing and suggested actions)#16014
seanbudd merged 6 commits into
nvaccess:masterfrom
josephsl:i16009win11ModernKeyboardUIANotification

Conversation

@josephsl

@josephsl josephsl commented Jan 8, 2024

Copy link
Copy Markdown
Contributor

Link to issue number:

Closes #16009

Summary of the issue:

NVDA does not respond to UIA notification event coming from modern keyboard for announcing voice typing and suggested actions alerts. This is because these parts of modern keyboard are not focusable.

Description of user facing changes

In Windows 11, NVDA will announce voice typing and suggested actions (22H2 and later) from everywhere including top suggested action when data such as phone numbers is copied to clipboard.

Description of development approach

Added UIA notification event handler to emoji panel app module. Becasue the base (UIA NVDA object) implementation of notification event checks focused element, notifications form modern keyboard will be missed simply because voice typing and suggested actions are not keyboard focusable. In case of suggested actions, display string is odd, but the top suggestion is the name of the element that raises notification event.

Testing strategy:

Manual testing:

Prerequisites: Windows 11 22H2 or later, voice typing and suggested actions are on:

  1. Open Notepad (preferably an empty document).
  2. Press Windows+H to activate voice typing.
  3. Press Alt key to move focus to Notepad menu bar.
  4. Press Windows+H. NVDA will announce voice typing error alert.
  5. Press Escape to move focus back to the document.
  6. Type a phone number.
  7. Copy the just entered phone number. If suggested actions is enabled, NVDA will announce the top suggestion if available.

Known issues with pull request:

In Windows 11 21H2 (original release), voice typing error might be announced twice - testing shows that this is unique to 21H2 and was fixed in 22H2. Also, if UIA event registration is set to "global", NVDA may announce voice typing alerts several times as both property change (name) and notification could be fired. However, notification event processing is better since it can work across global or selecive UIA event registration.

Code Review Checklist:

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

…in Windows 11.

Windows 11 modern keyboard features such as voice typing and suggested actions (Windows 11 22H2 and later) use UIA notification event to announce alerts. However, these elements are not focusable, therefore they will be dropped when handled by UIA object base implementation. Therefore, announce modern keyboard alerts and do not let the base UIA NVDA object handle it.
…string when announcing top suggested action (Windows 11 22H2).

Modern keyboard uses a really odd text to announce suggested actions (Windows 11 22H2 and later). However this element is in fact a top suggested action. Therefore treat object name as display string and announce it instead (also, keyboard interaction is impossible for suggested actions).
@josephsl josephsl requested a review from a team as a code owner January 8, 2024 02:41
@josephsl josephsl requested a review from gerald-hartig January 8, 2024 02:41
Comment on lines +311 to +312
self, obj: NVDAObject, nextHandler: Callable[[], None],
displayString: str | None = None, activityId: str | None = None, **kwargs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please split this into new lines for readibility

…eparate lines.

Note from Sean Budd (NV Access): one line per parameter for readability

@seanbudd seanbudd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @josephsl

@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Jan 8, 2024
@seanbudd seanbudd merged commit 7684c6d into nvaccess:master Jan 8, 2024
@nvaccessAuto nvaccessAuto added this to the 2024.2 milestone Jan 8, 2024
@josephsl josephsl deleted the i16009win11ModernKeyboardUIANotification branch January 22, 2024 04:29
Nael-Sayegh pushed a commit to Nael-Sayegh/nvda that referenced this pull request Feb 15, 2024
…typing and suggested actions) (nvaccess#16014)

Closes nvaccess#16009

Summary of the issue:
NVDA does not respond to UIA notification event coming from modern keyboard for announcing voice typing and suggested actions alerts. This is because these parts of modern keyboard are not focusable.

Description of user facing changes
In Windows 11, NVDA will announce voice typing and suggested actions (22H2 and later) from everywhere including top suggested action when data such as phone numbers is copied to clipboard.

Description of development approach
Added UIA notification event handler to emoji panel app module. Becasue the base (UIA NVDA object) implementation of notification event checks focused element, notifications form modern keyboard will be missed simply because voice typing and suggested actions are not keyboard focusable. In case of suggested actions, display string is odd, but the top suggestion is the name of the element that raises notification event.

Commits:


* Modern keyboard (emoji panel and friends): update copyright year

* Modern keyboard: introduce UIA notification event to announce alerts in Windows 11.

Windows 11 modern keyboard features such as voice typing and suggested actions (Windows 11 22H2 and later) use UIA notification event to announce alerts. However, these elements are not focusable, therefore they will be dropped when handled by UIA object base implementation. Therefore, announce modern keyboard alerts and do not let the base UIA NVDA object handle it.

* Modern keyboard/UIA notification: reclassify object name for display string when announcing top suggested action (Windows 11 22H2).

Modern keyboard uses a really odd text to announce suggested actions (Windows 11 22H2 and later). However this element is in fact a top suggested action. Therefore treat object name as display string and announce it instead (also, keyboard interaction is impossible for suggested actions).

* Modern keyboard: add NVDAObjects.NVDAObject and typing.Callable imports (for annotating events)

* Cangelog: add Windows 11 modern keyboard/UIA notification event handler entry

* Modern keyboard/UIA notification: split event handler parameters to separate lines.

Note from Sean Budd (NV Access): one line per parameter for readability
SaschaCowley pushed a commit to SaschaCowley/nvda that referenced this pull request Feb 27, 2024
…typing and suggested actions) (nvaccess#16014)

Closes nvaccess#16009

Summary of the issue:
NVDA does not respond to UIA notification event coming from modern keyboard for announcing voice typing and suggested actions alerts. This is because these parts of modern keyboard are not focusable.

Description of user facing changes
In Windows 11, NVDA will announce voice typing and suggested actions (22H2 and later) from everywhere including top suggested action when data such as phone numbers is copied to clipboard.

Description of development approach
Added UIA notification event handler to emoji panel app module. Becasue the base (UIA NVDA object) implementation of notification event checks focused element, notifications form modern keyboard will be missed simply because voice typing and suggested actions are not keyboard focusable. In case of suggested actions, display string is odd, but the top suggestion is the name of the element that raises notification event.

Commits:


* Modern keyboard (emoji panel and friends): update copyright year

* Modern keyboard: introduce UIA notification event to announce alerts in Windows 11.

Windows 11 modern keyboard features such as voice typing and suggested actions (Windows 11 22H2 and later) use UIA notification event to announce alerts. However, these elements are not focusable, therefore they will be dropped when handled by UIA object base implementation. Therefore, announce modern keyboard alerts and do not let the base UIA NVDA object handle it.

* Modern keyboard/UIA notification: reclassify object name for display string when announcing top suggested action (Windows 11 22H2).

Modern keyboard uses a really odd text to announce suggested actions (Windows 11 22H2 and later). However this element is in fact a top suggested action. Therefore treat object name as display string and announce it instead (also, keyboard interaction is impossible for suggested actions).

* Modern keyboard: add NVDAObjects.NVDAObject and typing.Callable imports (for annotating events)

* Cangelog: add Windows 11 modern keyboard/UIA notification event handler entry

* Modern keyboard/UIA notification: split event handler parameters to separate lines.

Note from Sean Budd (NV Access): one line per parameter for readability
Adriani90 pushed a commit to Adriani90/nvda that referenced this pull request Mar 13, 2024
…typing and suggested actions) (nvaccess#16014)

Closes nvaccess#16009

Summary of the issue:
NVDA does not respond to UIA notification event coming from modern keyboard for announcing voice typing and suggested actions alerts. This is because these parts of modern keyboard are not focusable.

Description of user facing changes
In Windows 11, NVDA will announce voice typing and suggested actions (22H2 and later) from everywhere including top suggested action when data such as phone numbers is copied to clipboard.

Description of development approach
Added UIA notification event handler to emoji panel app module. Becasue the base (UIA NVDA object) implementation of notification event checks focused element, notifications form modern keyboard will be missed simply because voice typing and suggested actions are not keyboard focusable. In case of suggested actions, display string is odd, but the top suggestion is the name of the element that raises notification event.

Commits:


* Modern keyboard (emoji panel and friends): update copyright year

* Modern keyboard: introduce UIA notification event to announce alerts in Windows 11.

Windows 11 modern keyboard features such as voice typing and suggested actions (Windows 11 22H2 and later) use UIA notification event to announce alerts. However, these elements are not focusable, therefore they will be dropped when handled by UIA object base implementation. Therefore, announce modern keyboard alerts and do not let the base UIA NVDA object handle it.

* Modern keyboard/UIA notification: reclassify object name for display string when announcing top suggested action (Windows 11 22H2).

Modern keyboard uses a really odd text to announce suggested actions (Windows 11 22H2 and later). However this element is in fact a top suggested action. Therefore treat object name as display string and announce it instead (also, keyboard interaction is impossible for suggested actions).

* Modern keyboard: add NVDAObjects.NVDAObject and typing.Callable imports (for annotating events)

* Cangelog: add Windows 11 modern keyboard/UIA notification event handler entry

* Modern keyboard/UIA notification: split event handler parameters to separate lines.

Note from Sean Budd (NV Access): one line per parameter for readability
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows 11 modern keyboard: respond to UIA notification events

3 participants