Key & modifier from Live to M4l

Brodie Matthews's icon

hii, i set up a m4l device with key commands is possible to pass key and modifier from live to max?

Tarik's icon

I too struggle with this. Any M4L device will ONLY register modifier keys if the device has been explicitly clicked on.
I've noticed the same issue with jsui elements: the function "onidle(x, y, button, _mod1, _shift, _caps, _opt, _mod2)" will give me the correct mouse position when hovering over the element, but will NOT give me accurate modifier key data until I've clicked on the patch.

This severely limits how fine-grained I can get the GUI experience to be. Has anyone found any solutions to this issue, or does any Cycling person wish to comment on this issue?

thanks! -t

Source Audio's icon

if you are lucky Mac user hi object would report any key or modifier no matter
if device has focus or not.
On Windows keyboard and mouse are not usable with hi object.

Tarik's icon

Thank you, this is news to me and it's almost really helpful. Unfortunately though I need this stuff to work cross platform.

Source Audio's icon

You would probably need to do it in java using global key listener

Tarik's icon

Thanks again! Yes your two suggestions do seem like the most sensible solutions, but neither of them is generally applicable enough: I don't just want it to work cross platform, it also needs to simply run after people have installed it, without requiring them to install Java.

Source Audio's icon

I am afraid ableton and m4l devices will never share key commands
without device getting focused.
If I understand correctly, you are asking that keys and modifiers get
received in m4l device without having focus, beside Live's
fixed key commands and user key map assignments.
I don't think that it would ever be allowed.

Tarik's icon

Yes that's indeed what I'm asking!

But actually, the question comes from a deeper issue, which is that there's an inconsistency within M4L: if an M4L device is not in focus, it will receive mouse events if the mouse overs over it, which also update the known state of modifier keys. However, once the mouse is still, the modifier keys status will NOT be updated.
If the device is in focus it receives all events correctly.

I'd also be fine if the M4L device wouldn't register ANY incoming mouse-and-kb events until it was selected, but then upon selecting would register all of it.

But it's the inconsistency between the ways that different states (in and out of focus) process different events (kb and mouse) that makes it hard to design a consistent GUI that makes use of all this data in an intuitive (= predictable) way.