tldraw
tldraw copied to clipboard
Positional keyboard shortcuts for toolbar
Adds positional keyboard shortcuts to the toolbar. Use the 1, 2, 3, 4 etc keys to activate the corresponding tool on the toolbar.
Change Type
- [x]
minor— New feature
Test Plan
- Use the number keys to activate toolbar items.
- [x] End to end tests
Release Notes
- You can now use the number keys to select the corresponding tool from the toolbar
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated (UTC) |
|---|---|---|---|
| examples | ✅ Ready (Inspect) | Visit Preview | Jan 26, 2024 2:48pm |
| tldraw-docs | ✅ Ready (Inspect) | Visit Preview | Jan 26, 2024 2:48pm |
This one might need some time for me to think through it. IIRC I avoided these shortcuts because of the design question—should they be based on positions? Should we force this as part of our UI, or make it part of the tool definition so that it could be more easily customized?
i would love for the "main"/"direct" keyboard shortcuts (e.g. 'd' for 'draw') to be customisable.
I think these extra ones make sense being strictly positional though (maybe with an option to disable if they conflict with your own app?) - there's no reason for 3 to be draw other than it being the 3rd item, but it is a very quick way to navigate the toolbar without having to learn a bunch of shortcuts or reach for your mouse. there's a lot of prior art for these in other apps that have a horizontal toolbar like ours
Ok, let's go!
neat!