- Messages
- 10,163
- Country

Hey all,
So, I need a code that has left and right rotation for things like Kohlsman and Heading, Altitude... But to also MiddleSingle click/select (MouseRect).
I was looking through stock existing codes for knobs in the ModelDef and find they are mostly all drag/X axis, 360 deg KF rotations.
Is... there.. such a thing as a regular dual/direction (left/right) rotation knob code that is not a drag - X axis type animation so that I can install other click types?
Sample;
What I would like... But the knob flips out, goes back and fourth.
What I need is the knob to rotate left with left click, right with right click, etc.
Is that possible with knob rotation animations with things like Heading, Kohlsman, Altitude, etc?
So, I need a code that has left and right rotation for things like Kohlsman and Heading, Altitude... But to also MiddleSingle click/select (MouseRect).
I was looking through stock existing codes for knobs in the ModelDef and find they are mostly all drag/X axis, 360 deg KF rotations.
Is... there.. such a thing as a regular dual/direction (left/right) rotation knob code that is not a drag - X axis type animation so that I can install other click types?
Sample;
Code:
<PartInfo>
<Name>knob_heading</Name>
<AnimLength>100</AnimLength>
<Animation>
<!-- <Rotation>Z</Rotation> -->
<Parameter>
<Sim>
<Variable>AUTOPILOT HEADING LOCK DIR</Variable>
<Units>radians</Units>
<MinValue>0</MinValue>
<MaxValue>100</MaxValue>
<Scale>20</Scale>
</Sim>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipID>TOOLTIPTEXT_AUTOPILOT_HEADING_INDICATOR</TooltipID>
<MouseFlags>LeftSingle+LeftDrag+Wheel</MouseFlags>
<CallbackJumpDragging>
<XMovement>
<Delta>1</Delta>
<EventIdInc>HEADING_BUG_INC</EventIdInc>
<EventIdDec>HEADING_BUG_DEC</EventIdDec>
</XMovement>
</CallbackJumpDragging>
</MouseRect>
</PartInfo>
What I would like... But the knob flips out, goes back and fourth.
What I need is the knob to rotate left with left click, right with right click, etc.
Is that possible with knob rotation animations with things like Heading, Kohlsman, Altitude, etc?
Code:
<PartInfo>
<Name>md302_knob</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(L:MD302 KNOB,bool) 100 *
</Code>
<Lag>200</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>MD302 BARO ADJ</TooltipText>
<MouseFlags>LeftSingle+RightSingle+WheelUp+WheelDown+MiddleSingle</MouseFlags>
<CallbackCode>
(M:Event) 'WheelDown' scmp 0 ==
(M:Event) 'LeftSingle' scmp 0 == or if{
(>K:KOHLSMAN_DEC)
(L:MD302 KNOB,bool) ! (>L:MD302 KNOB,bool)
}
(M:Event) 'WheelUp' scmp 0 ==
(M:Event) 'RightSingle' scmp 0 == or if{
(>K:KOHLSMAN_INC)
(L:MD302 KNOB,bool) ! (>L:MD302 KNOB,bool)
}
(M:Event) 'MiddleSingle' scmp 0 == if{
(L:MD302 SETTINGS MENU,bool) ! (>L:MD302 SETTINGS MENU,bool)
}
</CallbackCode>
</MouseRect>
</PartInfo>






