Exemplo n.º 1
0
    def type(self, s, blocking=True):
        """
        Sends keystrokes using send_input, also escaping the string for use in AHK.

        :param s: the string to type
        :param blocking: if ``True``, waits until script finishes, else returns immediately.
        """
        s = escape_sequence_replace(s)
        self.send_input(s, blocking=blocking)
Exemplo n.º 2
0
 def send(self, keys, delay=None, raw=False, blocking=False, escape=False):
     """
     Send keystrokes directly to the window.
     Uses ControlSend
     https://autohotkey.com/docs/commands/Send.htm
     """
     if escape:
         keys = escape_sequence_replace(keys)
     script = self._render_template('window/win_send.ahk', keys=keys, raw=raw, delay=delay, blocking=blocking)
     return self.engine.run_script(script, blocking=blocking)
Exemplo n.º 3
0
 def _send(self,
           keys,
           delay=10,
           raw=False,
           blocking=False,
           escape=False,
           press_duration=-1):
     if escape:
         keys = escape_sequence_replace(keys)
     script = self._render_template('window/win_send.ahk',
                                    title=f"ahk_id {self.id}",
                                    keys=keys,
                                    raw=raw,
                                    delay=delay,
                                    press_duration=press_duration,
                                    blocking=blocking)
     return script
Exemplo n.º 4
0
 def escape_sequence_replace(*args, **kwargs):
     return escape_sequence_replace(*args, **kwargs)
Exemplo n.º 5
0
Arquivo: keyboard.py Projeto: ziux/ahk
 def type(self, s):
     """
     Sends keystrokes using send_input, also escaping the string for use in AHK.
     """
     s = escape_sequence_replace(s)
     self.send_input(s)