|
1 | 1 | # A part of NonVisual Desktop Access (NVDA) |
2 | 2 | # This file is covered by the GNU General Public License. |
3 | 3 | # See the file COPYING for more details. |
4 | | -# Copyright (C) 2019-2022 Bill Dengler |
| 4 | +# Copyright (C) 2019-2022 Bill Dengler, Leonard de Ruijter |
5 | 5 |
|
6 | 6 | import ctypes |
7 | 7 | import NVDAHelper |
8 | 8 | import textInfos |
9 | 9 | import textUtils |
10 | 10 | import UIAHandler |
11 | | - |
| 11 | +import speech |
| 12 | +import controlTypes |
12 | 13 | from comtypes import COMError |
13 | 14 | from diffHandler import prefer_difflib |
14 | 15 | from logHandler import log |
15 | 16 | from UIAHandler.utils import _getConhostAPILevel |
16 | 17 | from UIAHandler.constants import WinConsoleAPILevel |
17 | | -from . import UIATextInfo |
| 18 | +from . import UIA, UIATextInfo |
18 | 19 | from ..behaviors import EnhancedTermTypedCharSupport, KeyboardHandlerBasedTypedCharSupport |
19 | 20 | from ..window import Window |
20 | 21 |
|
@@ -419,14 +420,11 @@ def findExtraOverlayClasses(obj, clsList): |
419 | 420 | clsList.append(consoleUIAWindow) |
420 | 421 |
|
421 | 422 |
|
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