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

feat: added keyboard controls for map gestures #1987

Merged
merged 28 commits into from
Feb 2, 2025
Merged

Conversation

JaffaKetchup
Copy link
Member

@JaffaKetchup JaffaKetchup commented Nov 19, 2024

This PR adds keyboard controls for the map, each of which may be toggled individually. By default, only the new arrow key gestures work - but maybe it would be better to enable them all?

Supports arrow & WASD keys for panning, QE keys for rotation, and RF keys for zoom (assuming QWERTY). All keys are physical not logical, so whatever key is in those positions on a QWERTY keyboard will work the same on others).

A potential extension could be to allow a key to be defined which resets the map rotation. And/or, to allow more customizability with keys (eg. to better support rotation and zooming for left handed users using the arrow keys).

Switched to using `Focus` instead of `KeyboardListener` to properly take focus and make bubbling decisions
Added optional external `foucsNode` & `autofocus` input to `KeyboardOptions`
Documented recommendation to enable arrow keys if WASD enabled (for left handed users)
Fixed returned `KeyEventResult`s
@JaffaKetchup JaffaKetchup requested review from a team and removed request for ibrierley, mootw, TesteurManiak and josxha November 24, 2024 21:02
@JaffaKetchup JaffaKetchup enabled auto-merge (squash) January 12, 2025 21:23
@JaffaKetchup
Copy link
Member Author

JaffaKetchup commented Jan 27, 2025

Copy link
Contributor

@josxha josxha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JaffaKetchup JaffaKetchup merged commit a4c30ad into master Feb 2, 2025
7 checks passed
@JaffaKetchup JaffaKetchup deleted the arrow-keys branch February 2, 2025 18:37
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.

2 participants