Decoupled throttle + Decouple fixes

master
Spike 9 years ago
parent 812f7f1de5
commit 8015e24946

File diff suppressed because it is too large Load Diff

@ -2,11 +2,36 @@ include "target.tmh"
include "StarCitizenMappings.tmh" include "StarCitizenMappings.tmh"
char DECOUPLED_MODE; char DECOUPLED_MODE;
char FAST_DECOUPLED; char FAST_DECOUPLED;
char LONG_DECOUPLED; char LONG_DECOUPLED;
int set_throttle_to_strafe()
{
int ZONES = LIST(0,40,45,50,55,60,100);
KeyAxis(&Throttle, THR_RIGHT, 0, AXMAP2(
ZONES,
Strafe_Backward,
PULSE+Strafe_Backward,
0,
0,
PULSE+Strafe_Forward,
Strafe_Forward
)
);
return 0;
}
int set_throttle_to_default()
{
KeyAxis(&Throttle, THR_RIGHT, 0, 0);
return 0;
}
//program startup //program startup
int main() int main()
{ {
@ -59,12 +84,12 @@ int main()
////// SCX (Jostick Skew Button) ////// SCX (Jostick Skew Button)
MapAxis(&Throttle, SCX, MOUSE_X_AXIS, AXIS_NORMAL, MAP_RELATIVE); //MapAxis(&Throttle, SCX, MOUSE_X_AXIS, AXIS_NORMAL, MAP_RELATIVE);
SetSCurve(&Throttle, SCX, 0, 10, 0, 0, -3); //SetSCurve(&Throttle, SCX, 0, 10, 0, 0, -3);
////// SCY (Jostick Skew Button) ////// SCY (Jostick Skew Button)
MapAxis(&Throttle, SCY, MOUSE_Y_AXIS, AXIS_REVERSED, MAP_RELATIVE); //MapAxis(&Throttle, SCY, MOUSE_Y_AXIS, AXIS_REVERSED, MAP_RELATIVE);
SetSCurve(&Throttle, SCY, 0, 10, 0, 0, -3); //SetSCurve(&Throttle, SCY, 0, 10, 0, 0, -3);
////// Throttle ////// Throttle
@ -115,7 +140,11 @@ int main()
// DECOUPLED MODE // DECOUPLED MODE
/////////////////////////////////////// ///////////////////////////////////////
DECOUPLED_MODE = 0; DECOUPLED_MODE = 0;
FAST_DECOUPLED = 0; LONG_DECOUPLED = 0;
MapKey(&Joystick, S4, MapKey(&Joystick, S4,
TEMPO( TEMPO(
/// On Short Press Toggle Fast Decoupled /// On Short Press Toggle Fast Decoupled
@ -125,14 +154,16 @@ int main()
"printf(\"Fast Decoupled Toggled\\xa\");" "printf(\"Fast Decoupled Toggled\\xa\");"
"DECOUPLED_MODE = 1;" "DECOUPLED_MODE = 1;"
"ActKey(KEYON+PULSE+Decoupled_Trigger);" "ActKey(KEYON+PULSE+Decoupled_Trigger);"
" ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT+LED1));" "ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT+LED1));"
"set_throttle_to_strafe();"
), ),
//// Stop FAST_DECOUPLED //// Stop FAST_DECOUPLED
EXEC( EXEC(
"printf(\"Fast Decoupled Release\\xa\");" "printf(\"Fast Decoupled Release\\xa\");"
"DECOUPLED_MODE = 0;" "DECOUPLED_MODE = 0;"
"ActKey(KEYON+PULSE+Decoupled_Trigger);" "ActKey(KEYON+PULSE+Decoupled_Trigger);"
" ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED1));" "ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED1));"
"set_throttle_to_default();"
) )
), ),
@ -142,12 +173,14 @@ int main()
EXEC( EXEC(
"DECOUPLED_MODE = 1;" "DECOUPLED_MODE = 1;"
"LONG_DECOUPLED = 1;" "LONG_DECOUPLED = 1;"
"ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT+LED1));"
"ActKey(KEYON+Decoupled_Trigger);" "ActKey(KEYON+Decoupled_Trigger);"
//"set_throttle_to_strafe();"
), ),
LED(&Throttle, LED_ONOFF, LED_CURRENT+LED1) LED(&Throttle, LED_ONOFF, LED_CURRENT+LED1)
), ),
/// Tempo time /// Tempo time
100 200
) )
); );
@ -159,10 +192,18 @@ int main()
"if (LONG_DECOUPLED) ActKey(Decoupled_Trigger);" "if (LONG_DECOUPLED) ActKey(Decoupled_Trigger);"
"if (LONG_DECOUPLED) ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED1));" "if (LONG_DECOUPLED) ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED1));"
"if (LONG_DECOUPLED) LONG_DECOUPLED = 0;" "if (LONG_DECOUPLED) LONG_DECOUPLED = 0;"
//"set_throttle_to_default();"
) )
); );
///////////////////////////////////////
// END DECOUPLED MODE
///////////////////////////////////////

@ -126,6 +126,7 @@ define SpaceBrake_Newtonian_Brake SPC //
define Match_Target_Velocity_Toggle_On PULSE+'m' define Match_Target_Velocity_Toggle_On PULSE+'m'
define Match_Target_Velocity_Toggle_Off PULSE+'m' // On Button Release define Match_Target_Velocity_Toggle_Off PULSE+'m' // On Button Release
define Decoupled_Trigger CAPS define Decoupled_Trigger CAPS
@ -135,3 +136,7 @@ define Roll_Switch S3
/// Reverse Engine button /// Reverse Engine button
define Reverse_Engine LTB define Reverse_Engine LTB
define Strafe_Forward 'w'
define Strafe_Backward 's'

Loading…
Cancel
Save