Mouseup on knob.

For general discussion related FlowStone
Post Reply
User avatar
lalalandsynth
Posts: 600
Joined: Sat Oct 01, 2016 12:48 pm

Mouseup on knob.

Post by lalalandsynth »

So I need to use a mousup on a knob so the knob shows values while turned but does not do any switching until I let go of the knob. This works fine for smaller movements on the knob as I stay within the area when moving it a tiny bit.
However, when turning it say from fully ccw to fully cw , the cursor has moved out of the knob area and does not register the mouseup.

Or rather that is what I assume , but when I let go of the knob the cursor is stationed right on top of the knob ,so I am not sure what is going on. I do have to define an area for the mouse , so it must be that .

Any thoughts on how to solve this ?
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Mouseup on knob.

Post by trogluddite »

Yes, this is normal behaviour - the 'Mouse Up' primitives take things rather literally, only triggering for within-area button releases. The solution is to hook into the way that mouse dragging works...

If you're using 'Green', connect a 'Bool to False Trigger' to the 'Dragging' output of the 'Mouse Drag' primitive. When dragging, the 'Mouse Drag' primitive properly tracks the mouse outside of the original click area, so 'Dragging' going false is essentially an 'anywhere' mouse-up event.

Ruby works similarly. The 'mouseLUp' method gets called for a regular within-area mouse up. Once a drag has been started by calling 'captureMouse', subsequently letting go of the button will call 'mouseLUpCaptured' (and your mouseLUpCaptured' method should usually call 'releaseMouse', otherwise it won't end the drag!)
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
lalalandsynth
Posts: 600
Joined: Sat Oct 01, 2016 12:48 pm

Re: Mouseup on knob.

Post by lalalandsynth »

Bingo ! That was it , awesome!
Thanks
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Mouseup on knob.

Post by trogluddite »

You're welcome. :D

BTW, although this mouse-up behaviour can seem a little bit confusing at first, there is a good reason for it. If you start dragging from a 'source' mouse area, but let go of the button over a different 'destination' mouse area, the source area will receive its 'stop dragging' message, and the destination area will receive a normal mouse-up. This is what makes drag-and-drop features possible...
drag_and_drop_example.fsm
(2.17 KiB) Downloaded 878 times
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Mouseup on knob.

Post by tulamide »

trogluddite wrote:You're welcome. :D

BTW, although this mouse-up behaviour can seem a little bit confusing at first, there is a good reason for it. If you start dragging from a 'source' mouse area, but let go of the button over a different 'destination' mouse area, the source area will receive its 'stop dragging' message, and the destination area will receive a normal mouse-up. This is what makes drag-and-drop features possible...
drag_and_drop_example.fsm

Ooooh, that is a nice example! I never thought of using the behaviour like this! Now we just need IAC or at least windows drag'n'drop and we're back to modern gui design.
"There lies the dog buried" (German saying translated literally)
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Mouseup on knob.

Post by trogluddite »

tulamide wrote:Now we just need IAC or at least windows drag'n'drop and we're back to modern gui design.

Well, we only had to wait about a dozen years for mouse-wheel support (in a broken version of FS!), so maybe there's hope yet! :lol:
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
lalalandsynth
Posts: 600
Joined: Sat Oct 01, 2016 12:48 pm

Re: Mouseup on knob.

Post by lalalandsynth »

Wow, that is very cool . Wish we had drag and drop to and from daw ;)
User avatar
Spogg
Posts: 3368
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England
Contact:

Re: Mouseup on knob.

Post by Spogg »

trogluddite wrote:... This is what makes drag-and-drop features possible...


Mon dieu! :o

This is brilliant Trog and sparked off my few remaining brain cells.

Have a look at a possible application for setting the contents and order of an FX chain...

Cheers

Spogg
Attachments
Drag and drop for FX ordering v0.001 .fsm
(851.75 KiB) Downloaded 898 times
User avatar
lalalandsynth
Posts: 600
Joined: Sat Oct 01, 2016 12:48 pm

Re: Mouseup on knob.

Post by lalalandsynth »

Nice Spogg !
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: Mouseup on knob.

Post by RJHollins »

Cool stuff Guys !
8-)
Post Reply