Repository navigation
Map editor: keyboard shortcuts for tools, zoom, scrolling and panning - #106
Open
Xehanort88 wants to merge 1 commit into
Open
Xehanort88 wants to merge 1 commit into
Xehanort88 wants to merge 1 commit into
Conversation
On the flat map, with no dialog up and no text field in use: - B, R, C, F pick the pencil, rectangle, circle and fill; E and S toggle the eraser and the shadow pen. Each button's tooltip ends with its key. - Ctrl with +, - and 0 zooms in, out and to 100%; Ctrl+/ fits the map in the panel. Zoom is about the middle of the panel and uses the wheel's own steps and limits. - The arrow keys scroll by one tile (Event mode keeps them for its cursor). - Space held over the map turns a left drag into a pan, beside the middle button and Shift+drag. The painter stands down for that drag. The key table is utils/MapShortcuts.js. The 3D view keeps its fly keys, and the sidebar lists and open dropdowns keep their letters. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Contributor
Author
|
A note on CI for this pull request and the three stacked on it (#107, #108, #109):
( The same test fails in the same shard on 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First of four pull requests for the map editor. The other three build on this one: turned tiles, then Tiled exchange, then a few editor extras. Each later pull request contains this commit, so this one is best reviewed and merged first.
The problem
The map editor had almost no keyboard shortcuts. Choosing a tool, zooming, or moving around a large map meant going to the toolbar or the scrollbars every time. Tiled, RPG Maker and most tile editors let you do these from the keyboard.
What changed
On the flat map, when no dialog is open and no text field has focus:
Each toolbar button's tooltip now ends with its key, so the keys can be found without documentation.
editor/src/utils/MapShortcuts.js.UIManager.handleMapShortcutacts on it.Verification
editor/tests/map-shortcuts.test.cjsloads the realMapShortcuts,UIManagerandTilemapManagercode and drives them. It covers every key, the cases where a key must be ignored (a text field, a dialog, Event mode, the 3D view), zoom limits, and Space-panning.Limits
🤖 Generated with Claude Code