Skip to content

Commit

Permalink
catch error if a character has no keycode
Browse files Browse the repository at this point in the history
  • Loading branch information
mchilli committed Nov 8, 2024
1 parent deb0a67 commit 16a299a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion circuitpython/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,11 @@ def run_macro(self, item: tuple[str, list], *args) -> None:
if isinstance(key, (int, float)):
time.sleep(key)
elif isinstance(key, str):
self.macropad.keyboard_layout.write(key)
try:
self.macropad.keyboard_layout.write(key)
except ValueError:
# if any of the characters has no keycode
pass
elif isinstance(key, dict):
if 'kc' in key:
key_codes = [
Expand Down

0 comments on commit 16a299a

Please sign in to comment.