windowsinternal_composableshell_experiences_textinput_inputapp.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:wintenApps 作者: josephsl 项目源码 文件源码
def event_UIA_elementSelected(self, obj, nextHandler):
        # #7273: When this is fired on categories, the first emoji from the new category is selected but not announced.
        # Therefore, move the navigator object to that item if possible.
        # However, in recent builds, name change event is also fired.
        # For consistent experience, report the new category first by traversing through controls.
        speech.cancelSpeech()
        # And no, if running on build 17040 and if this is typing suggestion, do not announce candidate window changes, as it is duplicate announcement and is anoying.
        if obj.UIAElement.cachedAutomationID == "IME_Candidate_Window": return
        candidate = obj
        if obj.UIAElement.cachedClassName == "ListViewItem":
            # The difference between emoji panel and suggestions list is absence of categories/emoji separation.
            # If dealing with keyboard entry suggestions (build 17040 and later), return immediately.
            candidate = obj.parent.previous
            if candidate is None:
                ui.message(obj.name)
                nextHandler()
                return
            ui.message(candidate.name)
            obj = candidate.firstChild
        if obj is not None:
            api.setNavigatorObject(obj)
            obj.reportFocus()
            braille.handler.message(braille.getBrailleTextForProperties(name=obj.name, role=obj.role, positionInfo=obj.positionInfo))
        else:
            # Translators: presented when there is no emoji when searching for one in Windows 10 Fall Creators Update and later.
            ui.message(_("No emoji"))
        nextHandler()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号