Hotkeys, anyone?

Hi all, rapha from IRC here. So far I’ve only been a lurker but this warrants a post, so here goes. Each time I’m using LibrePCB (which is not that often for lack of time) I notice I’d have more fun working with it if there were hotkeys for everything. That’s not so easy to get right and I’ve been asked to prepare a list of what would need to have a hotkey in the first place. Seems like a spreadsheet might be helpful for having such a discussion:

(Apologies to anyone who doesn’t have a Google Account - it sucks having to make these assumptions. Please let me know and I’ll send an .ods or .xlsx your way!)

Looking forward to your criticisms and comments!

Hi Rapha,

Yes, LibrePCB needs a good set of hotkeys :+1:

First thing I would say is that the easiest key to strike is ‘space’, so we have to use it a lot.
I think also that shortcut should be contextual.
For example, when you are dragging a component, ‘space’ should rotate.
But when you are drawing a wire, it should change orientation (ok, it some kind of rotation !) of the wire (cf

And there’s also other easy accessible keys : ‘tab’, ‘backspace’ & ‘enter’

I think we should think about contextual scenarii.
For example, when you are drawing a wire, it is natural to type ‘backspace’ to delete the last segment.
It might also be natural to change layer with ‘page up’/‘page down’ or +/-, or directly with ‘1’ to ‘9’ keys.

And also, I think that we should be able to see a list of what is possible in the current context.
Something like this is implemented in Kicad when you type ‘?’.
The problem is that in Kicad it is never up to date :woman_facepalming:



Thanks for the list @rapha!

I noticed that single-character shortcuts (e.g. “R” for rotate) are currently a problem when adding new components, since the focus is in the “value” input field in the toolbar. This is by purpose to allow specifying the value (e.g. the resistance of the added resistor) immediately when adding a component. But unfortunately it conflicts with shortcuts. A possible solution might be to stop moving the focus automatically into the text field. For example in LibreCAD there is also an input field, and the space key is used to put the focus in it. So for example when adding a resistor you would need to press SPACE+10k+ENTER to specify a value of 10k.

Yeah, such a list would be nice :+1: To avoid outdated information, I wonder if it makes sense to already make shortcuts configurable in workspace settings (see this issue), since this way the displayed shortcuts are just taken from the settings.

Btw, Altium has nice documentation about its keyboard shortcuts, might be worth to take a look at it:

@ubruhin , I do not say that shortcuts should be configurable.

And to precise, having an up-to-date list of available shortcuts means adding some code to filter the available ones in the current state.

And for values, I think it would be preferable to use ‘tab’ to go to value field as if there’s many, it will be the same key (‘tab’) to go to the next one.

And this will also allow to keep ‘space’ for rotation :grin:

And thanks for the link of Altium shortcuts.

Hi, thanks for making this list,
the lack of shortcuts has also been a minor annoyance for me in using LibrePCB.
I have some thoughts with respect to the “Add components” hotkeys.
Currently, when the “Add components” dialog pops up, the search bar is focused, and that seems quite reasonable to me.
This would conflict with single-char shortcuts in that view, but as a workaround I propose to hardcode certain search queries (such as “r”) to force the first result to be a resistor.
If the first result is automatically selected, that would mean you could then add a resistor by pressing , , .

Seems that right click has two different functionality :

  • rotate
  • cancel action

So unpredictable result !

Another thought: currently, the automatical focus on the “value” text input when placing a component in the schematic conflicts with the use of arrow keys for moving the view around - I don’t know whether this can be resolved