Mouse auto-move with Ruby ?

DSP related issues, mathematics, processing and techniques
Post Reply
Tepeix
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Mouse auto-move with Ruby ?

Post by Tepeix »

A strange question about mousse and Ruby.

I have a pad/Slider, But i want the user able to click somewhere else to move it.

Using 2 Mouse Area it works, but when the user click on the second place, i want the cursor to jump where is the first control location.

Is it possible to do this in Ruby, to make a move the mousse somewhere here when clicking in the second place ??
User avatar
Spogg
Posts: 3368
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England
Contact:

Re: Mouse auto-move with Ruby ?

Post by Spogg »

Do you mean a jump function for the slider? So you can drag the handle or click on its “slot” somewhere and the handle will jump to that point?
Or something else (and weird)? ;)
Tepeix
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: Mouse auto-move with Ruby ?

Post by Tepeix »

Not easy to explain..

I want the mouse icon to jump to a position, when click on the second control, so the icon will be at the exact place of the pad control 1. (if not the pad will change value before the user move it)

Don't know if this is possible. One problem might be to know which relative place or offset the icon will need..
Attachments
Mouse auto move.png
Mouse auto move.png (32.39 KiB) Viewed 159419 times
User avatar
Spogg
Posts: 3368
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England
Contact:

Re: Mouse auto-move with Ruby ?

Post by Spogg »

So… you click on the slider’s handle and the mouse cursor moves to the icon where it can drag the square from the right location?

I don’t know if such a thing is possible. If it is, I suspect an exotic Ruby solution would be required (beyond me!).

My understanding of mousey stuff is that control goes over to Windows and there’s some sort of dialogue between Windows and FS. And that sentence tells you all you need to know about what I know about it. :lol:
Tepeix
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: Mouse auto-move with Ruby ?

Post by Tepeix »

Yes, not easy..

In fact i already go to another solution..
Sharing preset, a pad and a slider, the slider could move the pad and the pad the slider and they both use the same preset module.. (quite a mess but more manageable..)
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Mouse auto-move with Ruby ?

Post by tulamide »

It would be more helpful if you could give some context, because currently I don't see any need for this weird behavior. With context we might be able to suggest another way to go at it.

But if you insist, you'd need to do it with a self-programmed .dll, as mouse control, just like Spogg said, is in the hands of windows. There are functions to reset mouse position, but not available to us in Flowstone, only in winapi.
"There lies the dog buried" (German saying translated literally)
Tepeix
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: Mouse auto-move with Ruby ?

Post by Tepeix »

All my error with this was to use the prim x-y drag accumulate.. (but it works well for pad)

That's why i needed to move the mouse cursor. If you add another mouse area to it, each area would drag it.
But when you change area, you are in a very different position and the control will suddenly jump to another parameter.

It's possible to do another trick having 2 control, then transmitting the last value from one to another but it's a complex task with lot of wireless link to manage.

But it's even better to use a knob prim with ruby to make the control. In this case i erase the graphic from ruby.
Then i would use the hack function from Mgui prim (that are no more present in alpha but we could import the old prim) this make possible to move a module into another one. So i make it a cursor and the mouse area move with it. This way it's easy to have 2 mouse area that link to the same ruby control. And when we click on the other's one it doesn't reset the parameter but only increment it..

I do this on alpha so could not post an example, hope this image is comprehensible..
Attachments
Pad and Control sharing.png
Pad and Control sharing.png (917.2 KiB) Viewed 159288 times
Post Reply