Skip to content

Commit

Permalink
Merge pull request #97 from spyoungtech/escape-fix-equals
Browse files Browse the repository at this point in the history
Escape fix equals (#96)
  • Loading branch information
spyoungtech authored Sep 7, 2020
2 parents 1b27b0a + 6692f4b commit 962edaa
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ahk/templates/keyboard/send.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
{% block body %}
{% if delay %}SetKeyDelay, {{ delay }}{% endif %}

Send{% if raw %}Raw{% endif %} {{ s }}
Send{% if raw %}Raw{% endif %}, {{ s }}
{% endblock body %}
3 changes: 2 additions & 1 deletion ahk/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
'+': '{+}',
'{': '{{}',
'}': '{}}',
'#': '{#}'
'#': '{#}',
'=': '{=}'
}

_TRANSLATION_TABLE = str.maketrans(ESCAPE_SEQUENCE_MAP)
Expand Down
15 changes: 15 additions & 0 deletions tests/unittests/test_keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ def test_type(self):
self.ahk.type('Hello, World!')
assert b'Hello, World!' in self.notepad.text

def test_type_escapes_equals(self):
'''
/~https://github.com/spyoungtech/ahk/issues/96
'''
self.notepad.activate()
self.ahk.type('=foo')
assert b'=foo' in self.notepad.text

def test_sendraw_equals(self):
'''
/~https://github.com/spyoungtech/ahk/issues/96
'''
self.notepad.activate()
self.ahk.send_raw('=foo')
assert b'=foo' in self.notepad.text

def a_down():
time.sleep(0.5)
Expand Down

0 comments on commit 962edaa

Please sign in to comment.