n4gix
Resource contributor
- Messages
- 11,674
- Country

For some reason ACES provided a key event for setting the 4th digit of the transponder with a "carry" function, but didn't provide one for setting the 2nd digit...
...which is a real PITA if one only has two knobs for setting the XPDR code!
So, here's one solution for that missing key event. When incrementing the 2nd digit, upon reaching a count of 7, the very next "click" will increment the 1st digit. Similarly, when decrementing the 2nd digit, upon reaching a count of 0, the very next "click" will decrement the 1st digit:
...which is a real PITA if one only has two knobs for setting the XPDR code!
So, here's one solution for that missing key event. When incrementing the 2nd digit, upon reaching a count of 7, the very next "click" will increment the 1st digit. Similarly, when decrementing the 2nd digit, upon reaching a count of 0, the very next "click" will decrement the 1st digit:
Code:
<PartInfo>
<Name>B737_XPDR_100s</Name>
<AnimLength>9</AnimLength>
<Animation>
<Parameter>
<Code>
(A:TRANSPONDER CODE:1,number) 1000 % 100 / flr (>L:XPDR_100_Count,enum)
</Code>
</Parameter>
<Lag>30</Lag>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<MouseFlags>LeftSingle+RightSingle+WheelUp+WheelDown</MouseFlags>
<CallbackCode>
(M:Event) 'LeftSingle' scmi 0 ==
(M:Event) 'WheelUp' scmi 0 == or
if{
(>K:XPNDR_100_INC)
(L:XPDR_100_Count,enum) 7 == if{ (>K:XPNDR_1000_INC) }
}
(M:Event) 'RightSingle' scmi 0 ==
(M:Event) 'WheelDown' scmi 0 == or
if{
(>K:XPNDR_100_DEC)
(L:XPDR_100_Count,enum) 0 == if{ (>K:XPNDR_1000_DEC) }
}
1 (>L:XMLSND1,bool)
</CallbackCode>
</MouseRect>
</PartInfo>
