n4gix
Resource contributor
- Messages
- 11,674
- Country

I have encountered an issue that defies all of my attempts to resolve. I have multiple switches that are 3 position, center return. They are various 'trimming' switches that are left/right click, with spring-loaded center return. Most of them work as designed, however two simply do not. Here is the XML script for one that works:
Here is one that does not work properly.
When left-clicked, switch moves to the left position, on release it returns to center position.
When right-clicked, switch moves to right position, on release it snaps back to the left position!
Code:
<PartInfo>
<Name>ATR_ENG1_TRIM_SWITCH</Name>
<AnimLength>20</AnimLength>
<Animation>
<Parameter>
<Code>(L:ENG1_TRIM_SWITCH, number) 1 + 10 *</Code>
</Parameter>
</Animation>
<MouseRect>
<Cursor>HAND</Cursor>
<MouseFlags>LeftSingle+RightSingle+LeftRelease+RightRelease</MouseFlags>
<CallbackCode>
(M:Event) 'LeftSingle' scmp 0 == if{ 0x1129D (>L:LVEVENT, number) }
(M:Event) 'RightSingle' scmp 0 == if{ 0x1129E (>L:LVEVENT, number) }
(M:Event) 'LeftRelease' scmp 0 == if{ 0x1129E (>L:LVEVENT, number) 1 (>L:LVEVRELEASE, number) }
(M:Event) 'RightRelease' scmp 0 == if{ 0x1129D (>L:LVEVENT, number) 1 (>L:LVEVRELEASE, number) }
</CallbackCode>
</MouseRect>
</PartInfo>
Here is one that does not work properly.
When left-clicked, switch moves to the left position, on release it returns to center position.
When right-clicked, switch moves to right position, on release it snaps back to the left position!
Code:
<PartInfo>
<Name>ATR_ENG1_LO_PITCH_SWITCH</Name>
<AnimLength>20</AnimLength>
<Animation>
<Parameter>
<Code>(L:ENG1_LO_PITCH_SWITCH, number) 1 + 10 *</Code>
</Parameter>
</Animation>
<MouseRect>
<Cursor>HAND</Cursor>
<MouseFlags>LeftSingle+RightSingle+LeftRelease+RightRelease</MouseFlags>
<CallbackCode>
(M:Event) 'LeftSingle' scmp 0 == if{ 0x112A3 (>L:LVEVENT, number) }
(M:Event) 'RightSingle' scmp 0 == if{ 0x112A4 (>L:LVEVENT, number) }
(M:Event) 'LeftRelease' scmp 0 == if{ 0x112A4 (>L:LVEVENT, number) 1 (>L:LVEVRELEASE, number) }
(M:Event) 'RightRelease' scmp 0 == if{ 0x112A3 (>L:LVEVENT, number) 1 (>L:LVEVRELEASE, number) }
</CallbackCode>
</MouseRect>
</PartInfo>
Last edited:



