Mimic RightMouseClick with CTRL+LeftMouseClick

david | dj mod,mel script | Sunday, March 14th, 2010

I noticed that some people using wacom tablets find the stylus version of theĀ  right-mouse button to be a little clumsy. Since maya makes extensive use of right-mouse-button menus I wanted to see if I could find an alternative. As luck would have it, Roger Klado had already figured it all out and written it up in great detail, so all I had to do was extract the bits I needed and put them into a mel script.

The result is djObjMenu.mel. Make a shelf button or marking menu with this command

djObjMenu;

Run it and you'll find that CTRL+LeftMouseClick invokes the same behaviour in the viewport as the RightMouseClick. So for a stylus that would be CTRL+penDown instead of hover+sideButton. Some people may find this easier or more direct. Let me know if you do. I don't use a stylus, so I'm interested to hear your thoughts.

Look for djObjMenu.mel on my downloads page.

Update: I've realized that CTRL+LeftMouseClick is normally used in component mode to deselect things. If you run djObjMenu from userSetup.mel then you'll lose the ability to deselect components (unless you want to use Shift-LeftMouseClick to toggle them). Therefore I think it would be better to run djObjMenu from a shelf button, to be used when you are animating rather than modeling. Then restart maya to revert to normal. I'm going to look into making the script detect whether the context is component mode to avoid the conflict, but that may take me a while to figure out. I'll have to read Roger's instructions again!

So, I've edited my original post to remove the suggestion about userSetup.mel, which I've replaced with a shelf button suggestion. Apologies if I confused anybody.

1 Comment »

  1. A nice new nugget for the windows version of maya 2011 is somethng that came from the mac version of maya that's been there for years.
    These mel commands now work in the windows version of maya 2011:
    mouse -mouseButtonTracking 3;
    mouse -mouseButtonTracking 1;
    They let you use the windows key and ctl as middle and right mouse buttons, respectively. My workflow has these 2 commands in a custom marking menu so I can switch quickly between them. This lets me use my tablet with only a left tap, and if something comes up that doesn't support this mode, like ctl-deselecting, I quickly switch back to standard 3-button mouse mode. It works great!

    Comment by fahr — August 4, 2010 @ 7:51 am

RSS feed for comments on this post.

Leave a comment

You must be logged in to post a comment.

Powered by WordPress | Based on a theme by Roy Tanck