Skip to content

Commit

Permalink
Word 365: do not announce font attribute toggle messages if raised fr…
Browse files Browse the repository at this point in the history
…om UIA notification event (#10990)

Fixes #10950

Summary of the issue:
In recent Word 365 releases, NVDA will announce font attribute toggle message up to two times - a message defined by NVDA ,and a second time thanks to UIA notification event.

Description of how this pull request fixes the issue:
Builds on an earlier work on Word 365 UIA notification event suppression (#10851):

Adds a dedicated list in UIA.WordDocument class listing activity ID's NVDA should ignore.
Adds AccSN1, the activity Id for font attribute toggle messages.
  • Loading branch information
josephsl authored Sep 2, 2024
1 parent 2c9301a commit ec3d033
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions source/NVDAObjects/UIA/wordDocument.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,10 +607,15 @@ def event_textChange(self):
if not eventHandler.isPendingEvents("caret", self):
eventHandler.queueEvent("caret", self)

suppressedActivityIds = [
"AccSN1", # #10950: font attributes
"AccSN2", # #10851: delete activity ID
]

def event_UIA_notification(self, activityId=None, **kwargs):
# #10851: in recent Word 365 releases, UIA notification will cause NVDA to announce edit functions
# such as "delete back word" when Control+Backspace is pressed.
if activityId == "AccSN2": # Delete activity ID
# In recent Word 365 releases, UIA notification will cause NVDA to announce edit functions
# such as "delete back word" when Control+Backspace is pressed or font attributes are toggled.
if activityId in self.suppressedActivityIds:
return
super(WordDocument, self).event_UIA_notification(**kwargs)

Expand Down

0 comments on commit ec3d033

Please sign in to comment.