[Maxscript] dotNet Mouse click (or up) on max viewport

max

#1

Hi there.
I have been trying to catch mouse clicks or mouse up events on max viewport and I can’t use the mouse tool in maxscript .(Mouse tool interferes with the Quickslice tool in edtiable Poly )
I tried using “timer” with (dotNetClass “Control”).MouseButtons, but once the mouse is clicked it returns “left button pressed” event per timer interval.So I want to use a “mouse up” event but no luck finding one yet. What shuold I do?
Thanks in advance for the help…


#2

See Kevin Vandecar’s post on how to use MouseCallbacks.


#3

Thank You.
I will give it a try.

Nope It did nor worlk for me. :grinning:

Nevermind. I found the solution here

nope again it crashes max if you integrate it with quickslice.


#4

We have had a poser tool that uses dotnet.
On normal key press it would apply the pose. On a prolonged button press it would open a UI for more advanced pose functionality.

I don’t see how this couldn’t be extended to use pyside if you are using 2017+ to give a more robust solution.

I will chat to the super smart chap who managed to get this working for us and feedback his insight.


#5

Yes we are using 2017. Right now I am trying to find the solution in python.

Nope python crashes max when you try to get mouse clicks with pynput or mouse …


#6

Nope It did nor worlk for me.

Nevermind. I found the solution here

nope again it crashes max if you integrate it with quickslice.

Low level mouse hooks are a bitch to get right, and while it’s doable, the additional safeguards around it would mean pretty much reinventing MouseCallbacks anyway (been there). What was your MouseCallback version of the code that didn’t work for you?


#7

Hi.
I have solved the problem with the timer and an array.
Thank you.