tldraw / tldraw

whiteboard / infinite canvas SDK
https://tldraw.dev
Other
35.77k stars 2.2k forks source link

Keyboard shortcuts for color selection #1257

Open johnatannvmd opened 1 year ago

johnatannvmd commented 1 year ago

Could you please add some keyboard shortcuts to select colors. Another project does this with key combination. The "S" key opens foreground palette, after which you can select color with "12345", "qwert", "asdfg" keys.

tldraw can highlight palette and show the mnemonic keys on top of colors.

Or bring palette near the cursor for faster switch.

TodePond commented 1 year ago

This would be great!

JStuve commented 1 year ago

@steveruizok Moving the conversation here!

Here is a flow that I thought would blend well:

Screenshot 2023-06-20 at 2 39 05 PM

  1. Entering the style menu with 's' will focus you on the active color palette button. The 's' binding puts your hand in a spot to be able to navigate through the rest of the menu.

  2. While focused on the color palette selection, you can use the arrow keys to navigate within the first section or alternately jump to a button selection using the dynamic key binding. These keybindings are selected to prioritize the hand placement from previously selecting keybinding, 's', which feels natural when making selections.

    image
  3. Selecting 'TAB', will jump users down to a new section, and if applicable apply the same dynamic keybindings for button groups (This was not implemented). Note, in the first screenshot, the 3rd 'TAB' is probably the incorrect behavior as it should move out of the style menu to the next tabbable element.

Atreyu-94 commented 1 year ago

Because the letters are used for other functions, I had thought precisely about press twice the letter according to the color to get this color, for example:

peterkos commented 7 months ago

@steveruizok hello! friendly bump, saw this implementation was deferred in a PR a while back; any update to the style menu features that may conflict here?

AtharvaKamble commented 7 months ago

This issue is great! Was looking to open an enhancement issue for this very same feature, glad that it already exists.

tmke8 commented 4 months ago

Another option: selecting colors requires pressing shift as well. So, for example, shift+Q selects black while just pressing Q toggles the tool lock, as before.

EDIT: right now, there are already two shortcuts using shift: shift+H for flipping horizontally and shift+V for flipping vertically, but there are enough free letters such that this shouldn't be a problem