Receiving mouse clicks from panels

Robert Baldock's icon

I'd like to have a coloured rectangular panel or button which can receive and report mouse clicks. I've looked at lcd and ubutton which are great but the problem is I want to deploy this panel in Mira and neither of these object can be put into a Mira frame (yet).

I can put a panel object into a Mira frame but I can't figure out how to get it to report mouse events. Is there any way to do that? If not, are there any panel-like objects I can use instead?

Robert

vichug's icon

pictslider maybe ?

Pedro Santos's icon

Maybe [hover] and some clever routing of [mousestate] clicks when over a panel?

Max Patch
Copy patch and select New From Clipboard in Max.
Robert Baldock's icon

Pedro -

That is indeed very clever. ;-)

Many thanks for that - it looks perfect.

Robert

xanadu's icon

This was solved in a previous topic. Look here: https://cycling74.com/forums/momentary-switch-for-mira/

My final solution uses a stack of objects to register mouse clicks as well as Mira touches.

Robert Baldock's icon

Xanadu -

I did look at that thread when trying to solve my issue but it wasn't suitable for me as I don't want to use toggle switches in the mira.frame.

I like the solution posted by Pedro using hover and mousestate so will probably go down that route.

Robert

Robert Baldock's icon

Unfortunately, the hover + mousestate approach isn't going to work with Mira because the iPad doesn't support the notion of hovering or mice. So apologies for framing my question poorly.

As it happens, there's a solution built in to Mira which is the mira.multitouch object and mira.mt.fingers.

Thanks for all the input, however.

Robert

Pedro Santos's icon

I did find it somewhat strange, but I thought that you wanted to have some kind of control on the computer with the mouse and replicate that state on the iPad with a mira compatible object (panel, in this case).

Robert Baldock's icon

Pedro -

Not to worry, your example was still very useful. I think that combination of hover and mousestate is very powerful.

Robert