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

fixed repeated key presses when a modifier key is held #7435

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Rishab87
Copy link

Resolves #7282

Changes:
As @davepagurek proposed above, I have used .repeat check to make sure we can capture repeated presses and recording which keys were pressed in combination with the meta key, and then when the meta key is released, manually update _downkeys so that they're all set to false

Screenshots of the change:

img

PR Checklist

Copy link

welcome bot commented Dec 19, 2024

🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. And be sure to add yourself to the list of contributors on the readme page!

if (!this._areDownKeys()) {
this._setProperty('isKeyPressed', false);
this._setProperty('keyIsPressed', false);
if (e.which === 91 || e.which === 93) { // Meta key codes
Copy link
Contributor

Choose a reason for hiding this comment

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

On my mac, the left meta key generates code 224, so this branch never gets executed. Is there a reason for using e.which over checking if e.key === 'Meta'?

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.

Repeated key presses when a modifier key is held do not fire events
2 participants