kbaskett248 / adafruit_macropad

45 stars 21 forks source link

Handle exceptions raised while a key is pressed #12

Closed avi-perl closed 2 years ago

avi-perl commented 2 years ago

In a situation where the MacroPad is sending a command to the host computer to press a key, and the MacroPad encounters an exception, the key will remain pressed on the host computer with no way to release it. This has happened to me most annoyingly with keys like windows, shift, ctrl, etc. This causes an obvious disruption on the host computer.

This PR addresses this issue by lifting all keys when any exception is caught inside of code.py.