Skip to content

Add keyboard shortcuts for tools (V,B,R,L,U,1,2,3,X,O,G)#360

Open
constantinehuzenko wants to merge 1 commit intoamilich:mainfrom
constantinehuzenko:feature/extra-shortcuts
Open

Add keyboard shortcuts for tools (V,B,R,L,U,1,2,3,X,O,G)#360
constantinehuzenko wants to merge 1 commit intoamilich:mainfrom
constantinehuzenko:feature/extra-shortcuts

Conversation

@constantinehuzenko
Copy link

@constantinehuzenko constantinehuzenko commented Jan 29, 2026

This pull request adds keyboard shortcut support for game tools and improves the visibility of these shortcuts throughout the UI. Users can now quickly switch tools using their keyboard, and the assigned shortcuts are displayed in tooltips, sidebars, and command menus for better discoverability.

Screenshot 2026-01-29 at 1 04 35 AM

Keyboard shortcut integration and tool switching:

  • Added a shortcut property to ToolInfo and assigned intuitive shortcut keys to major tools in TOOL_INFO, such as 'b' for bulldoze, 'r' for road, and number keys for zoning tools.
  • Implemented global keyboard handling in Game.tsx to allow switching tools using the defined shortcuts, replacing the previous hardcoded key handling. [1] [2] [3]

UI enhancements for shortcut visibility:

  • Updated the sidebar and hover submenu to display each tool's shortcut key next to its name, making shortcuts easily discoverable. [1] [2]
  • Modified the command menu system to include and display shortcut keys for tools, zones, and other menu items. The MenuItem type and all relevant menu item builders now include the shortcut property, and the command menu UI shows the shortcut next to each item. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

Minor improvements:

  • Fixed a missing dependency in a useEffect hook in Game.tsx for proper effect execution.

Note

Low Risk
Low risk: mostly UI/input plumbing around tool selection; primary risk is shortcut collisions or unintended tool switching in edge cases.

Overview
Adds a shortcut field to TOOL_INFO and assigns default keys to core tools/zoning actions (e.g., b, r, 1-3). Game.tsx now derives a key→tool map from TOOL_INFO and uses it in the global keydown handler (replacing the prior hardcoded bulldoze shortcut) to switch tools when no modifier keys are held.

Improves shortcut discoverability by rendering shortcuts alongside tool names in the sidebar flyouts and the command menu, and extends command menu items to carry/display the shortcut metadata. Also fixes a missing useEffect dependency (gt) in Game.tsx.

Written by Cursor Bugbot for commit f0c9da1. This will update automatically on new commits. Configure here.

@assert-app
Copy link

assert-app bot commented Jan 29, 2026

Your pull request is now ready for review with Assert.

Open Review →


Stop waiting for your code to break. Ship with confidence using Assert.

@vercel
Copy link
Contributor

vercel bot commented Jan 29, 2026

@constantinehuzenko is attempting to deploy a commit to the andrew-4640's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant