Right now I'm using rotary encoders wired into a Teensy in such a way that each detent fires off a button press, then in the joystick config I have something like this
- Code: Select all
<button n="7">
<desc>Heading bug right</desc>
<binding>
<command>property-adjust</command>
<property>/autopilot/settings/heading-bug-deg</property>
<step type="double">1</step>
</binding>
<repeatable type="double">1</repeatable>
</button>
<button n="8">
<desc>Heading bug left</desc>
<binding>
<command>property-adjust</command>
<property>/autopilot/settings/heading-bug-deg</property>
<step type="double">-1</step>
</binding>
<repeatable type="double">-1</repeatable>
</button>
This works great, but I'd like to be able to press another button to toggle between large and small step values. So I press a button, it switches the step value to +5/-5, I press it again and it returns the step value to +1/-1.
One idea I had was to do all the logic on the Teensy and use an extra two buttons like this:
- Code: Select all
<button n="9">
<desc>Heading bug right</desc>
<binding>
<command>property-adjust</command>
<property>/autopilot/settings/heading-bug-deg</property>
<step type="double">1</step>
</binding>
<repeatable type="double">5</repeatable>
</button>
Obviously this is not ideal and will chew up my button outputs fairly quickly. My question is there a way using Nasal scripting to apply a modifier to the step value if a button is pressed? Or any other solution that might be more elegant?
Thanks.