keyboard
keyboard copied to clipboard
Using exit(0) inside on_press_key() lambda doesn't exit the program
If I use the following line:
keyboard.on_press_key("F4", lambda event: print("test"))
The message is printed, but if I try to exit instead, nothing happens at all:
keyboard.on_press_key("F4", lambda event: exit(0))
I also tried using sys.exit(0), but nothing happens.