示例#1
0
 def run_talon_script(ctx, script, m):
     with ctx:
         print(f"CONTEXT: {ctx}")
         print(f"SCRIPT: {script}")
         print(f"COMMAND: {m}")
         # script.run(actions, namespace=m)
         actions.next(ctx, script, m)
示例#2
0
 def run_talon_script(ctx, script, m):
     with ctx:
         print(f"CONTEXT: {ctx}")
         print(f"SCRIPT: {script}")
         print(f"COMMAND: {m}")
         #global uds_server
         #if uds_server is not None:
         #    uds_server.send_command(str(m))
         # script.run(actions, namespace=m)
         actions.next(ctx, script, m)
示例#3
0
    def key(key: str):
        global _typed_special
        global _typed_anything
        if key == 'enter' or ('-' in key and key != '-'):
            # Don't trigger extra key presses on special keys.
            _typed_special = True
        _typed_anything = True

        # print('key:', key)

        # actions.next() is how you reference the action you are overriding.
        actions.next(key)
示例#4
0
 def replace_words(words: Sequence[str]) -> Sequence[str]:
     try:
         return phrase_replacer.replace(words)
     except:
         # fall back to default implementation for error-robustness
         logging.error("phrase replacer failed!")
         return actions.next(words)