-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
rightButtonDown() Not Working #4348
Comments
What happens for you in this example: http://labs.phaser.io/view.html?src=src%5Cinput%5Cpointer%5Cpointer%20buttons.js ? If I press the left button and drag I get a yellow rectangle. If I press the right button I get a green one. If I press them both I get an aqua colored one. Looking at your code I can see you are using
With the above, if I hold down BOTH buttons, then release just the left one, it will log 'false' for the left button being down, because it's not as I just released it, but 'true' for the right button being down, because I'm still holding it. They're actually working as I always intended them to now, they were just bugged before. You can finally use them safely in update loops, for example. I think what you're trying to do is figure out which button was released, yes? Which in my mind calls for a different method. You can get the button that was released from the actual DOM event (so
But note that button IDs can be reassigned (left-handed devices, for example, can flip the button orders). It's probably safer to check the negative state of |
After upgrading, I have this same problem too - my code is assuming |
Not really sure, but it needs to be changed, because even logically the method names ( I think what needs to be offered are |
Hi, |
Thank you for submitting this feature request. We have implemented this and the feature has been pushed to the |
OS: Windows 10
Browser: Google Chrome
The following code worked on Phaser 3.15 but as soon as I upgraded to 3.16 the following code does not trigger any more on right click.
I investigated further and found out that right clicks in 3.16 actually trigger the following code instead.
Note: the same behavior applies to the scroll wheel (middle mouse button) - when I press down on the scroll wheel button, noButtonDown() is true while middleButtonDown() is false.
Am I am doing anything wrong or did something change in the new update? I followed the API Documentstion and these methods are still there. Any help is appreciated.
The text was updated successfully, but these errors were encountered: