Skip to content

MS Word with UIA: Ensure braille is updated when typing text #13020

Merged
michaelDCurran merged 1 commit into
betafrom
i12970
Nov 3, 2021
Merged

MS Word with UIA: Ensure braille is updated when typing text #13020
michaelDCurran merged 1 commit into
betafrom
i12970

Conversation

@michaelDCurran
Copy link
Copy Markdown
Member

Link to issue number:

Fixes #12970
Fixes #13004
Regression caused by pr #12868

Summary of the issue:

When accessing an MS Word document via UIA, the braille display is not updated when typing characters into the document, although it does correctly update if the caret is moved with the arrow keys and such.
Generally, NVDA tells braille to update for each caret event. However, In Microsoft Word, although the caret does technically move when typing characters, Microsoft Word only fires a UIA textchange event (NVDA textChange event), and not a caret event (UIA textSelectionChanged event).

Before pr #12868 , Braille did seem to update correctly, but that was because NvDA was incorrectly passing an MSAA caret event into the UIA NVDAObject with focus.

Description of how this pull request fixes the issue:

On the MS Word document NVDAObject, implement an event_textChange method which just instructs Braille to update.

Testing strategy:

Known issues with pull request:

None known.

Change log entries:

None needed - regression was in 2021.3 dev cycle.

New features
Changes
Bug fixes
For Developers

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

@michaelDCurran michaelDCurran added this to the 2021.3 milestone Nov 3, 2021
@michaelDCurran michaelDCurran requested a review from a team as a code owner November 3, 2021 06:12
@michaelDCurran michaelDCurran requested review from seanbudd and removed request for a team November 3, 2021 06:12
Copy link
Copy Markdown
Collaborator

@LeonarddeR LeonarddeR left a comment

Choose a reason for hiding this comment

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

I wonder whether this also fixes braille updates when working together in a document and the other party updates content on the line you're add. That would be a very nice side effect of this fix.

Copy link
Copy Markdown
Contributor

@feerrenrut feerrenrut left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@michaelDCurran michaelDCurran merged commit 9dfdb15 into beta Nov 3, 2021
@michaelDCurran michaelDCurran deleted the i12970 branch November 3, 2021 08:21
@LeonarddeR
Copy link
Copy Markdown
Collaborator

I just realised that this also applies to edit boxes in Visual Studio. We might want to generalize this to more instances of UIATextInfo.

def event_textChange(self):
# Ensure Braille is updated when text changes,
# As Microsoft Word does not fire caret events when typing text, even though the caret does move.
braille.handler.handleCaretMove(self)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't we also trigger vision update here, so that if someone has caret highlighting enabled the correct character is highlighted?

@michaelDCurran
Copy link
Copy Markdown
Member Author

michaelDCurran commented Nov 3, 2021

I just realised that this also applies to edit boxes in Visual Studio. We might want to generalize this to more instances of UIATextInfo.

I'd be happy to move this to UIA NVDAObject if you can confirm that these Visual Studio text fields used to work in 2021.2 (I.e. this is the same regression from #12868 ).
If not we should generalize this in NVDA 2022.1 instead.

@LeonarddeR
Copy link
Copy Markdown
Collaborator

There's definitely something broken but I can also reproduce it in older versions of NVDA. I will look into it.

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.

4 participants