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

Reset Pointer.buttons to 0 on mouseup #3964

Conversation

SonnyCampbell
Copy link

Please do not update the README or Change Log, we will do this when we merge your PR.

This PR (delete as applicable)

  • Fixes a bug

Describe the changes below:
The leftButtonDown(), rightButtonDown(), etc functions currently don't return false after releasing the button on the mouse. There's a check in Pointer.up() for:

if (event.buttons) { this.buttons = event.buttons; }

However event.buttons is always 0 on mouseup, so this.buttons never gets reset to 0.

@xRahman
Copy link

xRahman commented Oct 25, 2018

Hello,

there is still one problem even after applying your fix.

If you press a button (inside canvas), move the mouse out of canvas, release that button and move the mouse back into the canvas, button is reporeted in pointer events as 'down' even though it's not down anymore.

@rexrainbow
Copy link
Contributor

@xRahman Related issue: #3779

@photonstorm
Copy link
Collaborator

Thanks for this PR. I've implemented a fix into the Pointer class locally which resolves this issue, so although I'm not going to merge the PR, the fix is in and attributed to you in the change log.

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.

None yet

4 participants