Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
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)