Skip to content

Commit

Permalink
Fix backspace in Visual Studio editor (PR #13100)
Browse files Browse the repository at this point in the history
IAccessibleHandler.processGenericWinEvent: 
Tighten up filtering of MSAA caret events for non-MSAA focus objects to only filter for UIA Word documents, as other UIA documents seem to still depend on these MSAA caret events.

Fixes #13098 - Characters removed with backspace not reported in Visual studio.
Some UIA implementations such as Visual Studio do not fire their own UIA caret events, and therefore actually depend on these MSAA caret events.
  • Loading branch information
michaelDCurran authored Nov 26, 2021
1 parent eac82c9 commit 6fb24d3
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions source/IAccessibleHandler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,12 +539,20 @@ def processGenericWinEvent(eventID, window, objectID, childID):
winUser.EVENT_OBJECT_SHOW
):
if not isinstance(focus, NVDAObjects.IAccessible.IAccessible):
if isMSAADebugLoggingEnabled():
log.debug(
f"Ignoring MSAA caret event on non-MSAA focus {focus}, "
f"winEvent {getWinEventLogInfo(window, objectID, childID)}"
)
return False
# #12855: Ignore MSAA caret event on non-MSAA focus.
# as Chinese input method fires MSAA caret events over and over on UIA Word documents.
# #13098: However, limit this specifically to UIA Word documents,
# As other UIA documents (E.g. Visual Studio)
# Seem to rely on MSAA caret events,
# as they do not fire their own UIA caret events.
from NVDAObjects.UIA.wordDocument import WordDocument
if isinstance(focus, WordDocument):
if isMSAADebugLoggingEnabled():
log.debug(
f"Ignoring MSAA caret event on focused UIA Word document"
f"winEvent {getWinEventLogInfo(window, objectID, childID)}"
)
return False
if isMSAADebugLoggingEnabled():
log.debug(
"handling winEvent as caret event on focus. "
Expand Down

0 comments on commit 6fb24d3

Please sign in to comment.