Scripted mouse tools in max

Hi All,

I’m playing around with scripted mouse tools and I’ve noticed that if you press the middle mouse button after the left button has been pressed, it exits the tool. This happens on object creation as well. Does anyone know how to stop this from happening?

I want to allow the user to be able to pan and rotate whilst in the tool and only have the right mouse button cancel.

Cheers,

Paul

The last time I made a mouse tool I only had a two button mouse, so this might not help at all.

I think the first thing to do would be to add an on mouseAbort handler with a print to confirm that the middle button is triggering the abort handler.

Then something like…


on mouseAbort clickNo do
(
    if mbutton do
    (
        somethingInnocuous()
    )
    else #stop
)

…based on the theory that if you don’t handle the abort event, Max will do it for you.

Hope that helps.

Cheers,

Drea

Unfortunately I’ve tried that and it doesn’t work. I’ve even tried re-starting the mouse tool if it aborts via the middle button and still no joy. Back to the drawing board me thinks.

Cheers,

Paul

Yup, I gave it a shot today and I couldn’t make it work either. I think you’re out of luck :(:

I suppose you could try rolling your own, but I wouldn’t fancy it myself. Could get ugly pretty quickly.

Cheers,

Drea

It’s not documented but the middle button exits on object creation as well so I guess it works as intended.

I went with the mouseTrack function in the end which works fine.

You wrote a brilliant too! Support youFAG轴承FAG轴承FAG轴承

This unwanted MMB-escape is the reason I gave up on mousetool and went with mousetrack/pickpoint solution.
Users do want to be able to tumble the view while creating objects.