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

Add method to enable/disable cooperative gestures #2152

Merged
merged 14 commits into from
Feb 13, 2023

Conversation

kevinschaul
Copy link
Contributor

@kevinschaul kevinschaul commented Feb 7, 2023

Add method to enable/disable cooperativeGestures (fixes #2057)

Disable cooperative gestures in fullscreen, using these new methods (fixes #1488)

Add a debug page for cooperative gestures because the feature cannot
be tested with a fullscreen map, and the only other test page is
a fullscreen map.

Change how meta key is detected for cooperative gestures

UIEvents like 'wheel' include properties for whether some keys are
currently pressed, including ctrl and meta. [0] This should be less
prone to error, specifically when the user presses or depresses one of
these keys while the browser document is not active.

[0] https://w3c.github.io/uievents/#dom-mouseevent-ctrlkey

Launch Checklist

  • Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!
  • Briefly describe the changes in this PR.
  • Link to related issues.
  • Write tests for all new functionality.
  • Document any changes to public APIs.
  • Add an entry to CHANGELOG.md under the ## main section.

UIEvents like 'wheel' include properties for whether some keys are
currently pressed, including ctrl and meta. [0] This should be less
prone to error, specifically when the user presses or depresses one of
these keys while the browser document is not active.

Adds a debug page for cooperative gestures because this feature cannot
be tested with a fullscreen map, and the only other test page is
a fullscreen map.

[0] https://w3c.github.io/uievents/#dom-mouseevent-ctrlkey
Fixes maplibre#2057

Also disable cooperative gestures in fullscreen, using these new methods
(Fixes maplibre#1488)
src/ui/map.ts Outdated Show resolved Hide resolved
src/ui/map.ts Show resolved Hide resolved
src/ui/map.ts Outdated Show resolved Hide resolved
src/ui/map.ts Outdated Show resolved Hide resolved
@HarelM
Copy link
Collaborator

HarelM commented Feb 8, 2023

Amazing work! Thanks!!
I've added some comments for you to look at.
Also the tests are failing.
Ping me if you need me to run the tests on the CI.

src/ui/map.ts Outdated Show resolved Hide resolved
@HarelM
Copy link
Collaborator

HarelM commented Feb 13, 2023

Overall looks good. Can you explain why the extra pan-x pan-y are needed now when they were not needed before?

@HarelM HarelM merged commit 176ed20 into maplibre:main Feb 13, 2023
@kevinschaul
Copy link
Contributor Author

Thanks for the help with the review!

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

Successfully merging this pull request may close these issues.

Add a method to enable / disable cooperativeGestures Disable cooperative gestures in fullscreen
3 participants