Here's the code snippets I ended up commenting out. First the function (which I stuck in AD_EDFunctions):
int axisUpdateFA() { // If Any Axis is 75% to 100% set FA Off, else set FA On
if(
(Axis[DX_X_AXIS].pos < -16383 | Axis[DX_X_AXIS].pos > 16383) |
(Axis[DX_Y_AXIS].pos < -16383 | Axis[DX_Y_AXIS].pos > 16383) |
(Axis[DX_XROT_AXIS].pos < -16383 | Axis[DX_XROT_AXIS].pos > 16383) |
(Axis[DX_YROT_AXIS].pos < -16383 | Axis[DX_YROT_AXIS].pos > 16383) |
(Axis[DX_Z_AXIS].pos < -16383 | Axis[DX_Z_AXIS].pos > 16383)
)
{
ActKey(KEYON+FlightAssist);
}
else
{
ActKey(FlightAssist);
}
}
(Note: The numbers are what I calculated the 75% +/- to be as the KeyAxis commands only trigger once when shifting over a boundary, and while they don't always report the same position they don't give a lot of wiggle room. I'm sure there's a function or property out there that will translate the actual position values into a percentage of max, but I had a hard enough time just figuring out how to read the position values at all.)
And then the KeyAxis commands you supplied got used as follows:
KeyAxis(&Joystick, JOYX, 0, AXMAP1(LIST(0,25,75,100), EXEC("axisUpdateFA();"), EXEC("axisUpdateFA();"), EXEC("axisUpdateFA();")));
KeyAxis(&Joystick, JOYY, 0, AXMAP1(LIST(0,25,75,100), EXEC("axisUpdateFA();"), EXEC("axisUpdateFA();"), EXEC("axisUpdateFA();")));
KeyAxis(&Throttle, SCX, 0, AXMAP1(LIST(0,25,75,100), EXEC("axisUpdateFA();"), EXEC("axisUpdateFA();"), EXEC("axisUpdateFA();")));
KeyAxis(&Throttle, SCY, 0, AXMAP1(LIST(0,25,75,100), EXEC("axisUpdateFA();"), EXEC("axisUpdateFA();"), EXEC("axisUpdateFA();")));
I decided to skip checking for the rudder as I plan to replace my thrustmaster rudder which I can't stand with a set of crosswinds next month, so would lose the functionality anyway.
In test this works great in test as it will keypress Z on turning and release Z on ending a turn. In game I had to go switch the FAOff command to hold instead of toggle. And after several rounds of fumbling it seemed to work... Except at some point it would just stop responding. Everything else worked fine. The script was still running, but hard turns or thrusts seem to stop sending the Z commands (which still works if you manually hit Z on the keyboard)..
At which point my geek curiosity just ran out of steam. I don't spend that much time in combat. This just seemed like a really cool idea to try out.
In any case, speedy recovery on the eye surgery. I'm actually envious. I would love to get rid of these glasses.