def event_nameChange(self, obj, nextHandler):
# In recent versions, live region change event is used instead, so don't announce messages with this method.
if isinstance(obj, UIA):
uiElement = obj.UIAElement
if uiElement.cachedClassName == "TextBlock" and obj.next is not None:
# Announce typing indicator (same as Skype for Desktop).
nextElement = obj.next.UIAElement
# Make sure to catch all possible UI placement changes between Skype UWP releases.
if nextElement.cachedAutomationID in ("ChatEditBox", "ChatTranslationSettings"):
# Translators: Presented when someone stops typing in Skype app (same as Skype for Desktop).
ui.message(obj.name if obj.name != "" else _("Typing stopped"))
nextHandler()
# The live region changed event for messages has no automation ID whatsoever.
# Unfortunately, Skype message fires name change, so be sure to perform one or the other.
评论列表
文章目录