Skip to content

Commit

Permalink
handle array and rm space
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeparticle committed Aug 21, 2022
1 parent b804c4b commit 0433c84
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion code_samples/macOS/google_chrome/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ def make_keystrokes(keys, delay):
print("Button released.")
if isinstance(key_output, (list, tuple)) and isinstance(key_output[0], dict):
for k in key_output:
make_keystrokes(k['keys'], k['delay'])
if isinstance(k['keys'], list):
for i in k['keys']:
make_keystrokes(i, k['delay'])
else:
make_keystrokes(k['keys'], k['delay'])
else:
make_keystrokes(key_output, delay=0)
button_state = False
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ def make_keystrokes(keys, delay):
print("Button released.")
if isinstance(key_output, (list, tuple)) and isinstance(key_output[0], dict):
for k in key_output:
make_keystrokes(k['keys'], k['delay'])
if isinstance(k['keys'], list):
for i in k['keys']:
make_keystrokes(i, k['delay'])
else:
make_keystrokes(k['keys'], k['delay'])
else:
make_keystrokes(key_output, delay=0)
button_state = False

0 comments on commit 0433c84

Please sign in to comment.