From be082550c983187586cb9c69b9e74629376ff9b8 Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Sun, 28 Aug 2022 15:58:18 -0700 Subject: [PATCH] NVDAObjects.UIA: introduce base implementation of UIA item status property event. Re #13973. Announce item status UIA property whenever it changes provided that there is no pending event of the same coming from the same element. Note that both the element name and item status are announced. --- source/NVDAObjects/UIA/__init__.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source/NVDAObjects/UIA/__init__.py b/source/NVDAObjects/UIA/__init__.py index 64940454722..1127da1834c 100644 --- a/source/NVDAObjects/UIA/__init__.py +++ b/source/NVDAObjects/UIA/__init__.py @@ -27,6 +27,7 @@ import config import speech import api +import eventHandler import textInfos from logHandler import log from UIAHandler.types import ( @@ -2035,6 +2036,20 @@ def event_UIA_notification(self, notificationKind=None, notificationProcessing=U speech.cancelSpeech() ui.message(displayString) + def event_UIA_itemStatus(self): + """ + Base implementation of UIA item status property event. + By default NVDA will announce element name and item status if any. + """ + itemStatus = self.UIAElement.currentItemStatus + # Filter duplicate events. + if ( + eventHandler.isPendingEvents(eventName="UIA_itemStatus", obj=self) + ): + return + ui.message(f"{self.name} {itemStatus}") + + class TreeviewItem(UIA): def _get_value(self):