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

Click and control key #2167

Closed
yuvalsv opened this issue Oct 27, 2015 · 3 comments
Closed

Click and control key #2167

yuvalsv opened this issue Oct 27, 2015 · 3 comments

Comments

@yuvalsv
Copy link

yuvalsv commented Oct 27, 2015

When the user tries to select an sprite using "ctrl + left click" the click event will get fire a first time, after that the sprite freeze and you won't be able to click on it again. It is happening on Chrome and IE11. You can test this behaviour here

http://phaser.io/examples/v2/basics/02-click-on-an-image

This also occurs on buttons. I have also find out that if you click using the right button you will be able to click on the sprite again.

Some of the users are using the control key to try to select multiple sprites.

Thanks in advance for your help.

@yuvalsv
Copy link
Author

yuvalsv commented Oct 27, 2015

After some research I have noticed that if I comment these lines on Phaser

    //  On OS X (and other devices with trackpads) you have to press CTRL + the pad
    //  to initiate a right-click event, so we'll check for that here

    if (event.ctrlKey && this.leftButton.isDown)
    {
        this.rightButton.start(event);
    }

It will work as expected. I don't have a Mac but I am guessing it won't work for these devices if I do this.

@photonstorm
Copy link
Collaborator

Honestly I can't think of an easy way to avoid this. We either don't allow ctrl + click on Windows, or we don't allow right-clicks on OS X. I'm not sure either is better than the other.

Suggestions?!

photonstorm added a commit that referenced this issue Feb 17, 2016
…1, this should allow you to use ctrl as a key modifier on Windows (and any device with a multi-button mouse attached) and still use ctrl + click on OS X / trackpads for a right-click (thanks @yuvalsv #2167)
@photonstorm
Copy link
Collaborator

Figured out a nice way to resolve this. Fix now in dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants