From cd1437debae0413be20a595ab9d937b4929d6d26 Mon Sep 17 00:00:00 2001
From: theadam <theadam@theadam.eu>
Date: Sun, 13 Apr 2025 15:44:15 +0200
Subject: [PATCH] + Fix: Handle only Windows-Terminal specific UIA events, not
 everything

---
 wt-access/README.md           | 2 +-
 wt-access/WindowsTerminal.JSS | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/wt-access/README.md b/wt-access/README.md
index 5941f90..bd9ada0 100755
--- a/wt-access/README.md
+++ b/wt-access/README.md
@@ -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
 - Prevent announcing unneccessary information (honour the keyboard echo setting)
 - 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
diff --git a/wt-access/WindowsTerminal.JSS b/wt-access/WindowsTerminal.JSS
index 671f584..4bbaa9e 100755
--- a/wt-access/WindowsTerminal.JSS
+++ b/wt-access/WindowsTerminal.JSS
@@ -110,6 +110,7 @@ EndFunction
 void function UIANotificationEvent(int notificationKind, int notificationProcessing, string displayString, string activityId, string appname)
 ;Say (activityId, OT_NONHIGHLIGHTED_SCREEN_TEXT)
 var string ki = ProcessUiaText(displayString)
+if appname == "WindowsTerminal"
 if activityId == "TerminalTextOutput"
 if WindowsTerminalLastKeyPress >= 2
 WindowsTerminalLastKeyPress = 0
@@ -122,4 +123,7 @@ ENDIF
 else
 Say (ki, OT_NONHIGHLIGHTED_SCREEN_TEXT)
 ENDIF
+ELSE
+UIANotificationEvent(notificationKind, notificationProcessing, displayString, activityId, appname)
+EndIf
 EndFunction