- Messages
- 35
- Country

I like to type these out and hopefully teach myself something trying to explain them in addition to maybe getting a tip from you wizards.
My switch is a 3 way switch with a spring back to center but the return to center is controlled by a separate input than the movement right and left.
So 3 states. 0,1,2. 5 inputs. 0_on, 0_off, 1_on, 2_on, 2_off.
I want to be able to drag left / right and return to center but I also have mouse rectangles that have logic that seem to do what I want but I can't get it into the drag.
This mouse rectangle logic moves the switch to the right and then back again.
I would like to cram this into something like this...taken from another post for its drag and return functionality but I already bastardized it.
The drag to either side works but doesn't return.
My switch is a 3 way switch with a spring back to center but the return to center is controlled by a separate input than the movement right and left.
So 3 states. 0,1,2. 5 inputs. 0_on, 0_off, 1_on, 2_on, 2_off.
I want to be able to drag left / right and return to center but I also have mouse rectangles that have logic that seem to do what I want but I can't get it into the drag.
This mouse rectangle logic moves the switch to the right and then back again.
Code:
(M:Event) 'LeftSingle' scmi 0 ==
if{ A:(state, enum) 1 == if { (>K:2_on) } }
(A:state, enum) 2 == if{ (>K:2_off) }
I would like to cram this into something like this...taken from another post for its drag and return functionality but I already bastardized it.
Code:
<MouseFlags>LeftSingle+LeftRelease+LeftDrag</MouseFlags>
<CallbackCode>
(M:Event) 'LeftSingle' scmi 0 == if{ (M:X) (>L:ClickStart,) }
(M:Event) 'LeftDrag' scmi 0 == if{ (M:X) (L:ClickStart,) < if{ (>K:0_on) }
els{ (>K:2_on) } }
</CallbackCode>
The drag to either side works but doesn't return.


