Repository: excalidraw
Issue: Extending the keyboard usage to element selection and modification
Labels: enhancement,shortcuts

I would like to expand upon @frantic's proposal on #3100 and also suggest that the keyboard usage could be extended to directly select and modify elements in the canvas as well. While we all use Excalidraw to precisely... *draw*, I think there is room for a great improvement if we are able to quickly point to elements we would like to work upon.

Evidently I'm in no position to say how you guys would implement this and neither if it is actually feasible, but if I'm allowed to give my two spoonfuls of ideas, you could try implementing it with a <kbd>Alt</kbd> key selector, similar to how Microsoft Office<sup>[obs]</sup> works. That way we don't mess with either existing tool shortcuts or the browser's, and we open a whole new space for creation.

## An Amateur's Vision of a New Feature

Say we have some elements on our canvas:

![2021 03 07_excalidraw com (1)](https://user-images.githubusercontent.com/23669137/110259936-e0479700-7f88-11eb-8f68-fac6f9224096.png)

---

By simply hitting the <kbd>Alt</kbd> key, the options for selection would show up (here I have cued your awesome approach to the colour shortcuts), from where the user would then press the corresponding key to select the element to change:

![2021 03 07_excalidraw com (2)](https://user-images.githubusercontent.com/23669137/110260122-b93d9500-7f89-11eb-832b-8e4b36b1dee8.png)

---

From there, the menu would also be entirely accessible with another key (and they would fit each element type accordingly):

![2021 03 07_excalidraw com (3)](https://user-images.githubusercontent.com/23669137/110261052-5c43de00-7f8d-11eb-928a-a6010a143818.png)

So let's say I want to change the fill colour of the first rectangle to orange. In this configuration I would have to type sequentially <kbd>Alt → 2 → b → g</kbd> and *voilà*! We have even integrated the existing shortcut for colour change.

## Dealing with how Users Arrange Their Canvases

Since Excalidraw drawings can become very messy to the point of not having enough keys for the existing elements, this feature could be further defined to take only visible elements into consideration. Let's say I have zoomed in and pressed the <kbd>Alt</kbd> key again:

![2021 03 07_excalidraw com (4)](https://user-images.githubusercontent.com/23669137/110261418-e771a380-7f8e-11eb-9bf4-34334071ae29.png)

Now only the elements which I'm supposedly interested in (since they are the only ones I'm looking at, after all!) make part of the possible selection.

---

Since this last element is a group of minor elements, Excalidraw could understand that I as a user would like to either select another individual element or modify the group as a whole, so let's allow for that:

![2021 03 07_excalidraw com (5)](https://user-images.githubusercontent.com/23669137/110261531-5e0ea100-7f8f-11eb-9f65-c09ebc65cf7d.png)

This way I could either change all the stroke colours by sequencing <kbd>Alt → 9 → e → s → w</kbd> Or just the first bar through <kbd>Alt → 9 → 4 → s → w</kbd>. By not demanding a key to be pressed down to either initiate or execute the commands, the interface becomes simple to handle as if a user were just typing a document.

---

Evidently my mock-up does not take into considerations possible conflicts (such as when I want to change **two** characteristics of my element: should I strike a sequence and return to no element selected or allow for further key strokes in the lateral menu? What about Library elements?) that could deter users from experiencing a flow state. But I personally think it would be a neat feature to be added to Excalidraw which at first glance seems to blend in with the overall *modus operandi* of this excellent tool.

Hopefully this does not end up compromising the performance too much for you guys to consider adding it!

**Obs:** I so wish other software followed this design, it really speeds up operations without needing <kbd>Alt</kbd>, <kbd>Ctrl</kbd>, <kbd>Shift</kbd> or a combination of them held down on the keyboard. This makes it prone to user error when they are thinking what to actually press to activate the command.