Skip to content

Commit 3ed04af

Browse files
authored
Merge 348d9ee into 737f7e1
2 parents 737f7e1 + 348d9ee commit 3ed04af

1 file changed

Lines changed: 12 additions & 14 deletions

File tree

source/NVDAObjects/UIA/winConsoleUIA.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
# A part of NonVisual Desktop Access (NVDA)
22
# This file is covered by the GNU General Public License.
33
# See the file COPYING for more details.
4-
# Copyright (C) 2019-2022 Bill Dengler
4+
# Copyright (C) 2019-2022 Bill Dengler, Leonard de Ruijter
55

66
import ctypes
77
import NVDAHelper
88
import textInfos
99
import textUtils
1010
import UIAHandler
11-
11+
import speech
12+
import controlTypes
1213
from comtypes import COMError
1314
from diffHandler import prefer_difflib
1415
from logHandler import log
1516
from UIAHandler.utils import _getConhostAPILevel
1617
from UIAHandler.constants import WinConsoleAPILevel
17-
from . import UIATextInfo
18+
from . import UIA, UIATextInfo
1819
from ..behaviors import EnhancedTermTypedCharSupport, KeyboardHandlerBasedTypedCharSupport
1920
from ..window import Window
2021

@@ -419,14 +420,11 @@ def findExtraOverlayClasses(obj, clsList):
419420
clsList.append(consoleUIAWindow)
420421

421422

422-
class WinTerminalUIA(EnhancedTermTypedCharSupport):
423-
def event_UIA_notification(self, **kwargs):
424-
"""
425-
In an upcoming terminal release, UIA notification events will be sent
426-
to announce new text. Block these for now to avoid double-reporting of
427-
text changes.
428-
@note: In the longer term, NVDA should leverage these events in place
429-
of the current LiveText strategy, as performance will likely be
430-
significantly improved and #11002 can be completely mitigated.
431-
"""
432-
log.debugWarning(f"Notification event blocked to avoid double-report: {kwargs}")
423+
class WinTerminalUIA(UIA):
424+
#: Override the role, which is controlTypes.Role.STATICTEXT by default.
425+
role = controlTypes.Role.TERMINAL
426+
#: New line text is announced using UIA notification events
427+
announceNewLineText=False
428+
429+
def event_UIA_notification(self, notificationKind, notificationProcessing, displayString, activityId):
430+
speech.speakText(displayString)

0 commit comments

Comments
 (0)