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

Differentiate between left click and right click as map events? #1405

Closed
misterfresh opened this issue Aug 4, 2015 · 4 comments
Closed

Differentiate between left click and right click as map events? #1405

misterfresh opened this issue Aug 4, 2015 · 4 comments

Comments

@misterfresh
Copy link

Is it possible to fire different events based on whether the click on the map is a right click or a left click?

@tmcw
Copy link
Contributor

tmcw commented Aug 4, 2015

The click event includes an originalEvent member, which has the same button property as the native DOM event. You can differentiate on this property with a basic if/else and fire other events as you choose.

@tmcw tmcw closed this as completed Aug 4, 2015
@misterfresh
Copy link
Author

Thanks!

@enjalot
Copy link

enjalot commented Dec 8, 2015

I noticed that the right click is actually captured by contextmenu and not included in the click event now. Googling led me here, so I figured I'd leave a comment for the next person

@bhousel
Copy link
Contributor

bhousel commented Dec 8, 2015

I noticed that the right click is actually captured by contextmenu and not included in the click event now. Googling led me here, so I figured I'd leave a comment for the next person

You're right - that's a bug.. We should continue to fire click events for right button.
Nevermind see #1416

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

No branches or pull requests

4 participants