I am using friction control wheel coupled with shift paddle to produce landing gear up/down cmmand...
I would like also the command in this sequence to make all led lights flash for 3 times when i select ldg gear up/down command...
KeyAxis(&Throttle,THR_FC,'i',AXMAP2(3,Toggle_landing_gear_up,0, Toggle_landing_gear_down));
Here is my sript file for dcs a-10C
"include "target.tmh" //here we link this file to the file that contains the default Thrustmaster function code
include "DCSA10Cv2.ttm"
int main()
{
Configure(&LMFD,MODE_EXCLUDED);
Configure(&RMFD,MODE_EXCLUDED);
if(Init(&EventHandle)) return 1; // declare the event handler, return on error
//script and function functions go here and before the }
// shift button
SetShiftButton(&Joystick,S4);
// set pulse and delay lengths
SetKBRate(30,100);
//////////////////////////////////////////////////////////////////////////////////
// Joystick and Throttle Axis Definitions
//////////////////////////////////////////////////////////////////////////////////
MapAxis(&Joystick, JOYX, DX_X_AXIS);
MapAxis(&Joystick, JOYY, DX_Y_AXIS);
MapAxis(&Throttle, THR_LEFT, DX_ZROT_AXIS);
MapAxis(&Throttle, THR_RIGHT, DX_Z_AXIS);
RotateDXAxis(DX_X_AXIS, DX_Y_AXIS, -15); //simulate a -15 deg twisted centred stick for the A-10.
// Uncomment following two lines if you want Slew Control axes available in-game
MapAxis(&Throttle, SCX, DX_XROT_AXIS);
MapAxis(&Throttle, SCY, DX_YROT_AXIS);
// For now, don't do anything with the Slew Control pressed in
MapKey(&Throttle,SC,0);
// Assign gear lever control to gray throttle friction lever
//KeyAxisIO(0,(&Throttle,THR_FC,0,AXMAP2(LIST(0,40,60,100),Toggle_landing_gear_up,0,Toggle_landing_gear_down)));
KeyAxis(&Throttle,THR_FC,'o',AXMAP2(3,Zoom_in_slow,0,Zoom_out_slow));
KeyAxis(&Throttle,THR_FC,'i',AXMAP2(3,Toggle_landing_gear_up,0, Toggle_landing_gear_down));
//KeyAxis(&Throttle,THR_FC,'i',AXMAP2(3,LED(&Throttle, LED_ONOFF, LED_CURRENT^LED1),0,LED(&Throttle, LED_ONOFF, LED_CURRENT^LED1)));
//KeyAxis(&Throttle,THR_FC,'i',AXMAP2
//(3,
//CHAIN(LED(&Throttle,LED_ONOFF, LED_CURRENT^LED1),D(500),LED(&Throttle, LED_ONOFF, LED_CURRENT^LED1),D(500),LED(&Throttle, LED_ONOFF, LED_CURRENT^LED1),D(500),LED(&Throttle, LED_ONOFF, LED_CURRENT^LED1),
//0,
//CHAIN(LED(&Throttle,LED_ONOFF, LED_CURRENT^LED1),D(500),LED(&Throttle, LED_ONOFF, LED_CURRENT^LED1),D(500),LED(&Throttle, LED_ONOFF, LED_CURRENT^LED1),D(500),LED(&Throttle, LED_ONOFF, LED_CURRENT^LED1)
//);
////////////////////////////////////////////////////////////////////////////////////
// Joystick Button Definitions
////////////////////////////////////////////////////////////////////////////////////
MapKey(&Joystick,TG1,Gun_trigger_first_stage);
MapKey(&Joystick,TG2,Gun_trigger);
MapKeyIO(&Joystick,S1,
SEQ( //open the sequence
CHAIN(
EXEC( // Curve 1
"SetSCurve(&Joystick, JOYX, 0, 0, 0, 1, 0); SetSCurve(&Joystick, JOYY, 0, 0, 0, 1, 0);"
),
LED(&Throttle, LED_ONOFF, LED_CURRENT+LED1)
),
CHAIN(
EXEC( // curve 2
"SetSCurve(&Joystick, JOYX, 0, 0, 0, 2, 0); SetSCurve(&Joystick, JOYY, 0, 0, 0, 2, 0);"
),
LED(&Throttle, LED_ONOFF, LED_CURRENT+LED1),
LED(&Throttle, LED_ONOFF, LED_CURRENT+LED2)
),
CHAIN(
EXEC( // curve 3
"SetSCurve(&Joystick, JOYX, 0, 0, 0, 3, 0); SetSCurve(&Joystick, JOYY, 0, 0, 0, 3, 0);"
),
LED(&Throttle, LED_ONOFF, LED_CURRENT+LED1),
LED(&Throttle, LED_ONOFF, LED_CURRENT+LED2),
LED(&Throttle, LED_ONOFF, LED_CURRENT+LED3)
),
CHAIN(
EXEC( // curve 4
"SetSCurve(&Joystick, JOYX, 0, 0, 0, 3, -1); SetSCurve(&Joystick, JOYY, 0, 0, 0, 3, -1);"
),
LED(&Throttle, LED_ONOFF, LED_CURRENT+LED1),
LED(&Throttle, LED_ONOFF, LED_CURRENT+LED2),
LED(&Throttle, LED_ONOFF, LED_CURRENT+LED3),
LED(&Throttle, LED_ONOFF, LED_CURRENT+LED4)
),
CHAIN(
EXEC( // curve 5
"SetSCurve(&Joystick, JOYX, 0, 0, 0, 4, -1); SetSCurve(&Joystick, JOYY, 0, 0, 0, 4, -1);"
),
LED(&Throttle, LED_ONOFF, LED_CURRENT+LED1),
LED(&Throttle, LED_ONOFF, LED_CURRENT+LED2),
LED(&Throttle, LED_ONOFF, LED_CURRENT+LED3),
LED(&Throttle, LED_ONOFF, LED_CURRENT+LED4),
LED(&Throttle, LED_ONOFF, LED_CURRENT+LED5)
),
CHAIN(
EXEC( // reset to straight
"SetSCurve(&Joystick, JOYX, 0, 0, 0 ,0, 0); SetSCurve(&Joystick, JOYY, 0, 0, 0 ,0, 0);"
),
LED(&Throttle, LED_ONOFF, LED_CURRENT-LED1),
LED(&Throttle, LED_ONOFF, LED_CURRENT-LED2),
LED(&Throttle, LED_ONOFF, LED_CURRENT-LED3),
LED(&Throttle, LED_ONOFF, LED_CURRENT-LED4),
LED(&Throttle, LED_ONOFF, LED_CURRENT-LED5)
)
) //close the Sequence
,HOTAS_Master_Mode_Control_Button);
MapKeyIO(&Joystick,S2,0,Weapon_release);
MapKeyIO(&Joystick,S3,0,HOTAS_nosewheel_steering_button);
MapKey(&Joystick,H1U,Trim_nose_down);
MapKey(&Joystick,H1D,Trim_nose_up);
MapKey(&Joystick,H1L,Trim_aileron_left);
MapKey(&Joystick,H1R,Trim_aileron_right);
MapKeyIO(&Joystick,H2U,0,HOTAS_TMS_up);
MapKeyIO(&Joystick,H2D,0,HOTAS_TMS_down);
MapKeyIO(&Joystick,H2L,0,HOTAS_TMS_left);
MapKeyIO(&Joystick,H2R,0,HOTAS_TMS_right);
MapKeyIO(&Joystick,H3U,0,HOTAS_DMS_up);
MapKeyIO(&Joystick,H3D,0,HOTAS_DMS_down);
MapKeyIO(&Joystick,H3L,0,HOTAS_DMS_left);
MapKeyIO(&Joystick,H3R,0,HOTAS_DMS_right);
MapKeyIO(&Joystick,H4U,Zoom_in_slow,HOTAS_CMS_forward);
MapKeyIO(&Joystick,H4D,Zoom_out_slow,HOTAS_CMS_aft);
MapKeyIO(&Joystick,H4L,0,HOTAS_CMS_left);
MapKeyIO(&Joystick,H4R,0,HOTAS_CMS_right);
//////////////////////////////////////////////////////////////////////////////////////
// Throttle Button Definitions
//////////////////////////////////////////////////////////////////////////////////////
// MIC HAT + views
MapKeyIO(&Throttle,MSU,F1,DX3);
MapKeyIO(&Throttle,MSD,F3,DX5);
MapKeyIO(&Throttle,MSL,F4,DX6);
MapKeyIO(&Throttle,MSR,L_CTL+F5,L_ALT+KP1);
MapKeyIO(&Throttle,MSP,SEQ(DOWN+KP5,UP+KP5),0);
MapKey(&Throttle,SPDB,DX8);
MapKey(&Throttle,SPDF,DX7);
MapKey(&Throttle,BSB,DX10);
MapKey(&Throttle,BSF,DX9);
MapKey(&Throttle,CHB,DX12);
MapKey(&Throttle,CHF,DX11);
MapKey(&Throttle,PSB,DX14);
MapKey(&Throttle,PSF,DX13);
MapKeyIO(&Throttle,LTB,KP5,TEMPO(F13,L_SHIFT+F12,500));
MapKey(&Throttle,CSU,DXHATUP);
MapKey(&Throttle,CSD,DXHATDOWN);
MapKey(&Throttle,CSL,DXHATLEFT);
MapKey(&Throttle,CSR,DXHATRIGHT);
MapKey(&Throttle,EFLNORM,DX16);
MapKey(&Throttle,EFRNORM,DX17);
MapKey(&Throttle,EOLMOTOR,DX18);
MapKey(&Throttle,EORMOTOR,DX19);
MapKey(&Throttle,APUON,DX20);
MapKey(&Throttle,LDGH,DX21);
MapKey(&Throttle,FLAPU,DX22);
MapKey(&Throttle,FLAPD,DX23);
MapKey(&Throttle,EACON,DX24);
MapKey(&Throttle,RDRNRM,DX25);
MapKey(&Throttle,APENG,DX26);
MapKey(&Throttle,APPAT,DX27);
MapKey(&Throttle,APALT,DX28);
MapKey(&Throttle,IDLELON,DX30);
MapKey(&Throttle,IDLERON,DX29);
MapKey(&Throttle,EOLIGN,DX31);
MapKey(&Throttle,EORIGN,DX32);
}
int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);
};"