+ Fix: Handle only Windows-Terminal specific UIA events, not everything

This commit is contained in:
theadam 2025-04-13 15:44:15 +02:00
parent 62d49f36f5
commit cd1437deba
2 changed files with 5 additions and 1 deletions

View file

@ -40,7 +40,7 @@ My script - based on Freedom's code - fixes this problem by adding the UIA suppo
- Turn off the every screen item auto-read feature and read only the changed content - Turn off the every screen item auto-read feature and read only the changed content
- Prevent announcing unneccessary information (honour the keyboard echo setting) - Prevent announcing unneccessary information (honour the keyboard echo setting)
- Support the auto-completion feature - Support the auto-completion feature
- Support - Support UIA only in Terminal (and let other events, E.G. volume changes to handle the default script)
## Known issues and todo ## Known issues and todo

View file

@ -110,6 +110,7 @@ EndFunction
void function UIANotificationEvent(int notificationKind, int notificationProcessing, string displayString, string activityId, string appname) void function UIANotificationEvent(int notificationKind, int notificationProcessing, string displayString, string activityId, string appname)
;Say (activityId, OT_NONHIGHLIGHTED_SCREEN_TEXT) ;Say (activityId, OT_NONHIGHLIGHTED_SCREEN_TEXT)
var string ki = ProcessUiaText(displayString) var string ki = ProcessUiaText(displayString)
if appname == "WindowsTerminal"
if activityId == "TerminalTextOutput" if activityId == "TerminalTextOutput"
if WindowsTerminalLastKeyPress >= 2 if WindowsTerminalLastKeyPress >= 2
WindowsTerminalLastKeyPress = 0 WindowsTerminalLastKeyPress = 0
@ -122,4 +123,7 @@ ENDIF
else else
Say (ki, OT_NONHIGHLIGHTED_SCREEN_TEXT) Say (ki, OT_NONHIGHLIGHTED_SCREEN_TEXT)
ENDIF ENDIF
ELSE
UIANotificationEvent(notificationKind, notificationProcessing, displayString, activityId, appname)
EndIf
EndFunction EndFunction