I can’t be sure as I’m not particularly experienced with the menuItem of maya.cmds (which btw I’m assuming that you mean?) but I would assume that by using that particular command you’re most likely bound to the features it exposes.
Having said that, if you were interested in venturing outside of commands-land and into Qt you may have some luck with something like this: >>> from PySide import QtGui>>> QtGui.QApplication.queryKeyboardModifiers() Which will look, in a global fashion, on which keys are being held at the time of invocation. As for menu within a menu, that sounds like you’ll be best off implementing a menu widget on your own, or perhaps hack the option-box to remove items for you. On 11 July 2014 12:59, johan Borgström <[email protected]> wrote: > Hi! > > I am building a basic menu populated with some menuItems. I want the user > to be able to add and remove menuItems to the menu. I have wrapped the menu > in a class and written some methods to help to add and remove menuItems. I > do not want to write a special ui to handle the removing of items, so my > idea is to check if the user holds a modifier key while clicking the > menuItem and if so delete it. Another idea is to use a right click popup > menu on the menuItem and have the option "delete item". > To add the command to the menuItem I use functools.partial. So to wrap it > up my questions are: > > > - How can I add a right click popup menu to a menuItem. > - How can I check if a modifier key was pressed when the menuItem was > clicked. > > Best Regards, > Johan > > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/643993ce-63d0-431a-b27e-20568cb74355%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/643993ce-63d0-431a-b27e-20568cb74355%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- *Marcus Ottosson* [email protected] -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOD-zgy%2BSfeabaRwxh%2Bvy115_bXidB-dy-xUXVjUqYb1Uw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
