Set hotkey for script execution?

Is there a way to set a hotkey to execute some python code?

The fastest way right now seems to create an Action Plugin and go through the menu, but I would like to run my plugin/code through the press of a button.

1 Like

I did some research on this, but I did not find a solution. Going with pure python is not platform independent, and would require installing additional packages, so I’ve tried wxPython.

I’ve managed to trigger an event with keypress while the action plugin was active, but I did not succeed in registering a keypress when action plugin was not running. For the time being I’ve suspended my efforts here as the wxpython support in KiCad is uncertain.

1 Like

As far as I know this isn’t possible. What Mitja tried is interesting, but in any case the shortcuts should be left for the end user to decide. KiCad isn’t far from the situation when it needs some kind of extensible shortcut, like emacs Ctrl-x, which would open practically endless possibilities for new key combinations.

1 Like

I never tried, but there probably exists external software for making keyboard macro’s.
Some mouses have software for re-configurable macro buttons.

1 Like

Yes, using external tools is an option, but from my perspective main point of action plugins is that an author can share his work with the rest of KiCad community. Requiring external tools, additional python packages, or OS specific solutions greatly limit the audience.

2 Likes

Sad to hear that there is no good solution for this problem right now. But I saw in the KiCAD 6 roadmap that they have a shortcut manager planned. So maybe we have to wait for its implementation…

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.