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

Release pressed keys when regaining focus in HTML5 builds #6423

Merged
merged 2 commits into from
Feb 21, 2022

Conversation

britzl
Copy link
Contributor

@britzl britzl commented Feb 18, 2022

If a key is pressed while the game lost focus and that key is released while not in focus the event will not be received for the key release. This will result in the key remaining in the pressed state when the game regains focus. To fix this we set all pressed keys to released before regaining focus.

Fixes #3186

Module['canvas'].removeEventListener(type, listener, useCapture);
}
},
removeEventListenerCanvas:function (type, listener, useCapture) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed indentation

@britzl britzl requested a review from JCash February 18, 2022 14:42
@britzl britzl merged commit 32cf678 into dev Feb 21, 2022
@britzl britzl deleted the Issue-3186-release-keys-when-canvas-focus-is-lost branch February 21, 2022 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants