Calling the shortcut from another editor?


I hope my description of the problem is not too weird.

I stumbled more than once across now that you can perform tools just from the editor where you want to perform the operation. Not from another editor type, even when it would make sense. And i ask myself if there is a way to globally access such local operators.

In my current case i wanted to place a little icon button in the topbar and the properties editor to set the brush strength and radius. So that the user can see at the tooltip then, ah this hotkey is assigned to set the radius. The problem is, in the Topbar and Properties Editor the hotkey does not show in the tooltip, which makes my button obsolete then. In the 3D view, where you use the brush, the tooltip does show the hotkey though.

Placing the button into the top bar makes it infact a second tool. It is now in another editor type. I can assign a shortcut to it, and this shortcut gets then created elsewhere in the keymap. Means now i have two independant tools, at least when it comes to the hotkey. It’s the same tool though. And works also the same in the top bar, it sets the radius or the strength of the brush in the 3D view. It just doesn’t use the same hotkey.

So is there a way to access the original hotkey by python from another editor? Or is this impossible by design?

Kind regards


There are most likely multiple issues here, but I assume you want a global hotkey for the operator across editors?

Global Hotkeys:
You can set “global” hotkeys by assigning the hotkey to the correct category, 3D View Generic is an example of a category that applies to all modes of the 3D View not just say Object Mode. Window is a category that should work across all editors the Ctrl+S hotkey is such a hotkey assigned to this category, if you want a “global” hotkey, use the window category.

Global Buttons/Operators:
If you want the same button/operator instance in multiple editors that is a very different issue. Because Blender’s windows can move around everywhere the UI uses a context based system. This system stops the user from getting a panel from Toolshelf and dragging it into the View Properties. It also stops a single instance being connected across editors/panels. You can reference an operator from multiple editors but it won’t be the same instance. Not even multiple UV editors have the same operator instances because their contexts are different.

If you want operator-hotkey access it would be best to go directly to keymap preferences/properties instead of settings up out-of-context operators in other menus.

Thanks, This helps already a bit :slight_smile: