Page 1 of 1

Mouseup on knob.

Posted: Sat Apr 20, 2019 9:58 pm
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 ?

Re: Mouseup on knob.

Posted: Sat Apr 20, 2019 10:51 pm
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!)

Re: Mouseup on knob.

Posted: Sat Apr 20, 2019 11:09 pm
by lalalandsynth
Bingo ! That was it , awesome!
Thanks

Re: Mouseup on knob.

Posted: Sun Apr 21, 2019 12:54 pm
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

Re: Mouseup on knob.

Posted: Sun Apr 21, 2019 1:05 pm
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.

Re: Mouseup on knob.

Posted: Sun Apr 21, 2019 1:35 pm
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:

Re: Mouseup on knob.

Posted: Sun Apr 21, 2019 4:15 pm
by lalalandsynth
Wow, that is very cool . Wish we had drag and drop to and from daw ;)

Re: Mouseup on knob.

Posted: Sun Apr 21, 2019 5:23 pm
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

Re: Mouseup on knob.

Posted: Sun Apr 21, 2019 7:04 pm
by lalalandsynth
Nice Spogg !

Re: Mouseup on knob.

Posted: Sun Apr 21, 2019 7:38 pm
by RJHollins
Cool stuff Guys !
8-)