Skip to content

🐞 Fix bug where frontmost application receives key events#631

Merged
mrkai77 merged 1 commit into
mrkai77:developfrom
zenangst:fix/issue-with-pressedKeys-mismatch
Dec 14, 2024
Merged

🐞 Fix bug where frontmost application receives key events#631
mrkai77 merged 1 commit into
mrkai77:developfrom
zenangst:fix/issue-with-pressedKeys-mismatch

Conversation

@zenangst
Copy link
Copy Markdown
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
Copy Markdown
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
@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