Is there any way to make a different menu appear when a user holds a modifier key when clicking the menu name in a header? I've created a menu that is appended to the 3d view header. I want to have it call the standard menu when the user clicks it, but if a modifier key like shift is used, a different menu could be called. Since menus don't have invoke classmethods, I can't directly check for events. I was wondering if anyone knew a trick.

The only thing I can think of is instead of appending a menu, append a button that calls a menu through bpy.ops.wm.call_menu(name="FOO_MT_Bar") in both cases, but I would prefer to have something that looks and behaves like a regular menu unless the modifier key event is used.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.