def _get_script_hacky(self):
#Workaround until DB 1.1 when I fix NVDA to not need repeated scripts.
#Mostly based on scriptHandler.findScript, but no globalGestureMapness
focus = api.getFocusObject()
if not focus:
return None
ti = focus.treeInterceptor
if ti:
func = self._getScriptFromObject(ti)
if func and (not ti.passThrough or getattr(func,"ignoreTreeInterceptorPassThrough",False)):
return (func, ti)
# NVDAObject level.
func = self._getScriptFromObject(focus)
if func:
return (func, focus)
for obj in reversed(api.getFocusAncestors()):
func = self._getScriptFromObject(obj)
if func and getattr(func, 'canPropagate', False):
return (func, obj)
# Global commands.
func = self._getScriptFromObject(globalCommands.commands)
if func:
return (func, globalCommands.commands)
dictationGesture.py 文件源码
python
阅读 17
收藏 0
点赞 0
评论 0
评论列表
文章目录