Open gatoniel opened 6 hours ago
hey @gatoniel, magicgui doesn't currently deal with customization of keybindings, so it would indeed be a feature request. (and your current solution of using the underlying .native
widget's API is indeed the only solution ... whether GPT gave you the most elegant approach for that is perhaps another question, but I don't think it's too far off).
Particularly in the context of napari, i think this is a feature that would require a good degree of consideration (since napari also manages keybindings for you, and it could get annoying to have to reconcile two different keybinding registries). If I were you, I would either stick with the solution of modifying the native widget, or, if your use case is strictly in napari, see if you can use napari's API for custom keyboard shortcuts
Hi, I wanted my widget to execute when I hit instead of clicking on the
Run
button with my mouse. Asking ChatGPT, I solved the problem with the following code:This works. But it seems overly complicated. Is there a way to accomplish the same by just setting a correct keyword argument? If not, can this be integrated as new feature?
Best, Niklas