Assigning two functions to one key


I’m wondering if it’s possible to assign two functions to one key, depending on if you hold it or press and release it.

I’m asking this because in ZBrush you can zoom by holding the Control key, while pressing and releasing the Control key initiates pan mode.

This is quite convenient, because you’ve got access to two navigation options with only one key. No more accidentally pressing the Windows key when you want to press Alt. :slightly_smiling_face:


You can customize hot keys. e.g. A, A+Shift, A+Ctrl, A+Alt, A+Ctrl+Alt, Ctrl+MMB etc.

Thanks, I know, but it’s the one-key combination that would be great, so I could navigate in Blender like in ZBrush. But it’s no big deal. I can keep using Shift + MMB for panning in Blender.

Perhaps creating a modal operator, that would call Op1, if release happens without a mouse move, and call Op2 if mouse move without release.

1 Like

Sounds good, thanks. I’m a total Python scripting nitwit though. If you or someone could help me create such a modal operator, I’d be grateful.

In ZBrush it works like this:

  • Press and hold Control + RMB + drag = zoom in or out.
  • Press Control + RMB (initiating zoom), then release Control + drag = pan.

The closest thing to ZB is to set them like this.
It works the same as you describe except for pan you just have to click and drag then click again to get out of pan.

1 Like