kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #40998
Re: PATCH pcbnew half-rotate actions and shortcuts
On 10/06/2019 23:35, Andrew Lutsenko wrote:
If adding 2 new default shortcuts is not ideal maybe there is a way to
have these as actions with no shortcuts and let the user choose if they
want to use them and assign any shortcut they want.Is that technically
supported with current hotkey framework?
This is supported by the framework, but there will need to be additional
UI for the "alt-step rotate" command to set the angle. Unless we just
use half the the normal angle (so 45 by default).
However, I'm not really sure throwing in hundreds of useful-to-some
actions across the program is really a great policy.
I'd like to be able to bind hotkeys to Python scripts [1]. For maximum
usefulness, parameters to the script are needed. So you don't need a
"rotate 45" and a "rotate -45" script, for example, you just need a
"rotate" script.
I can especially see this being useful for layer selections: there are
very many (we already have 10 in the layer context menu) of potentially
useful layer sets. E.g. a user might want to quickly
(enable|disable|toggle|set opacity) on some subset of layers at once,
and making an action for each one is doomed to fail. And which layers
are important is very dependent on the user and the PCB in question.
In this case, it's not reasonable for KiCad to ship an action for every
possible layer option. But if a script can apply any combination, and
also set the opacity and whatever, that's a very very powerful UI.
KiCad IMO should ship an excellent set of actions for "normal" users,
and advanced users should be allowed to extend the action palette with
their own customised actions [2].
Cheers,
John
[1]: Actually I'd "like" a "KiScript" hooked in over a message bus, so I
can send a command "select from U* where pin_count > 20; rotate 45;
zoom_fit selection; show_layer *.Cu; hide_layer *.SilkS;" from anywhere.
But that's a whole language, and probably not a good idea at all! Also
needs a concurrent access data model.
[2]: E.g. "place a inverting amp here using a 741 and 10k R1 and unity
gain" and it generates and plonks a pre-drawn schematic right there with
all the right parts. Or a resistor array just how you like it.
Follow ups
References