Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using exit(0) inside on_press_key() lambda doesn't exit the program #626

Open
8dcc opened this issue Jan 17, 2024 · 0 comments
Open

Using exit(0) inside on_press_key() lambda doesn't exit the program #626

8dcc opened this issue Jan 17, 2024 · 0 comments

Comments

@8dcc
Copy link

8dcc commented Jan 17, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant