system_hotkey
system_hotkey copied to clipboard
InvalidKeyError is cannot be caught via try-except block
import sys
from system_hotkey import SystemHotkey, InvalidKeyError
try:
hk = SystemHotkey()
hk.register(["alt","q'"], callback=lambda event: overlay.quit())
except InvalidKeyError:
sys.exit()
print('IT WENT HERE')
above code will continue and will not execute sys.exit()