Skip to content

Patch for keyPressed true with no keys pressed after specific sequence of SHIFT or CTRL #955

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

Closed
wants to merge 1 commit into from

Conversation

Rishab87
Copy link
Contributor

@Rishab87 Rishab87 commented Mar 7, 2025

The issue was that earlier we were using a hash for registering keys. For example, when someone pressed Ctrl and then A, the combination Ctrl+A got registered, and when they released Ctrl and then A, the Ctrl+A combination remained registered because it had a specific hash that was not released upon releasing both keys. That is why I removed the hash and am now directly registering the key.

However, I'm not sure why we were using a hash in the first place. Is there any specific reason? If yes, then I can change this approach.

Fixes #779

@Stefterv
Copy link
Collaborator

Hi @Rishab87 the hash is combining thekeyCode and key variables. I agree it's not very readable but I don't think switching back to only the keyCode is going to solve #779 properly.

Please try to replicate the issue in your tests in #966 and then feel free to solve it in that PR too!

Thank you!

@Stefterv Stefterv closed this Mar 13, 2025
@Rishab87
Copy link
Contributor Author

@Stefterv I've already replicated it in tests and it was working fine with this approach although I'm not sure about if this approach can cause any further issues, I'll try some different approach with hash present and fix it in that PR, thank you for the suggestion.

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

Successfully merging this pull request may close these issues.

keyPressed is true with no keys pressed after specific sequence of SHIFT and any letter key
2 participants