def event_nameChange(self, obj, nextHandler):
# NVDA, can you act as a mouthpiece for Cortana?
if isinstance(obj, UIA) and isinstance(obj.next, UIA) and obj.next.UIAElement.cachedAutomationID != "SpeechButton" and obj.name != self.cortanaResponseCache:
element = obj.UIAElement
# There are two Cortana response lines. Usually line 2 is more reliable.
# However, Redstone seems to favor line 1 better.
# A specific automation ID is used for reminders and others.
if element.cachedAutomationID in ("SpeechContentLabel", "WeSaidTextBlock", "GreetingLine1"):
ui.message(obj.name)
self.cortanaResponseCache = obj.name
nextHandler()
评论列表
文章目录