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

🐞 Fix bug where frontmost application receives key events #631

Merged

Conversation

zenangst
Copy link
Contributor

This fix addresses the issue where pressing multiple keys quickly can cause a discrepancy and send keyboard events to the frontmost application.

I added a new instance variable called lastKey because pressedKeys is a Set which is not ordered.

Using the new instance variable as a fallback has fixed the issue for me.

…y result in a discrepancy and transmit keyboard events to the front most application.

- Keep track of the last key event and use that as a fallback if multiple keys have been inserted into `pressedKeys`.
Copy link
Owner

@MrKai77 MrKai77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works like a charm, thank you so much! Also, I didn't know about how it was possible to put in #line inside print statements, love it!

@MrKai77 MrKai77 merged commit 0abc2ae into MrKai77:develop Dec 14, 2024
1 check passed
@MrKai77 MrKai77 changed the title Fix bug where front most application receives key events 🐞 Fix bug where frontmost application receives key events Dec 14, 2024
@MrKai77 MrKai77 added the Bug label Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants