Output mouse position when over objects

due_friday's icon

What I do not understand is, with several objects you can display the mouse position (like itable and function, when over over points) but you cannot output those values in any way.

The only way I know of is, on bang when mouse changed, dump all values, compare each to previous saved state and determine which value was changed.

But this is not what I always want:
- Sometimes I would like to know the values over which the user is hovering without having him to click anything
- Also, if I want to react to something by simply clicking on a value in itable or function without changing that value, my method above cannot determine which value has been clicked on, since no value was changed.

I mean, come on! Not just provide us with a bang out the right most outlet when clicking, send us a list of values we can work with!! I can always transform this into a bang if I have to afterwards, but so much information is lost when just outputting a bang on a mouse change event.

I have a feeling, Max is so inconsistent (some obejcts start indices at 0, some 1; messages for similar functions named differently in different objects) and screwy for legacy reasons, but this needs to be cleaned up and improved! It could be so much more useful!!

Andro's icon

The software is fine i think your just missing some programming basics.
Its better to admit your stumped. Post your patch and ask for help. Right ?
Theres an object for the mouse and it polls the data.
Use a gate. Open gate when mouse is clicked.
Learn to manipulate data
Use pack with the x y values. Put the mouse click output into the leftmost inlet. Get a snapshot of the values into a list.
Dont want a stream. Then use the past object set to 0.8 on mouse click output.
Need it stored in a list ?
Send the mouse cluck to counter plus x and y then send to coll.
theres so many ways to do this.
Do the first few tuts. They'll help you grasp the basics.

benniy's icon

who on earth would want every object to output all its data any time a mouse hovers it?

due_friday's icon

Hi Andro,

thanks for the tut, but I am well aware of [mousestate] (is this the object for the mouse you speak of?). Still, I fail to obtain the data when only hovering over the UI objects. For example, you have a function object. See how this object displays the X and Y values of the function when hovering over the object? (note: these are not the pixels on screen!) Unfortunately, your suggestions with mouse click won't work here.

Also, thanks again, but I do know how to manipulate data. Perhaps not as good as you do – perhaps...
I mean, I can
a) get the presentation position via [pattr] of the [function] object in question
b) track the mouse position relative to the patcher window
c) determine when the mouse is over the [function] object and calculate the mouse position relative to the object
d) correlate the X-Y position of the mouse with the "domain" and "range" of the [function] object
c) correct the calculation considering the horizontal and vertical zoom factors of [function]

...and yet, the object is calculating the values right there before my eyes, displaying it in the left upper corner and I have no way of getting at this data. No flag to set the output, no bang to report the current mouse position in the object.

Its not about the mouse position per se, its about the values associated with the mouse position inside the object. I know I can do this in a complicated manner using Max/MSP tricks, but it could be so much easier!!

>> Benny:
I think you misunderstood me. I am talking specifically about relevant data that the user is interacting with, even if he/she is not clicking on that object - or even WHEN they are clicking on it.

So, again, take a [function] object, for example: if a user clicks to generate a new data point or move a data point, the only reaction I get from [function] is a measly bang out the right most outlet. This "bang" could be sooo much more. Like, a list of the x and y data associated with the value change. I mean, the object is doing the math already in the background, why not provide it to me?