Now for the beauty - the Target Script File

Almost done, but a little more tweaking and ergonomic testing to finish up towards the bottom. This has been developed for ease of transition to CoD.
////////////////////////////////////////////////////////////
// Target Script File (TMC)
////////////////////////////////////////////////////////////
// Simulator: Il2 Sturmovik 46 V 4.10
// Date: 06_03_2011
// Prepared By: TX_Gunslinger
//
http://txsquadron.com//////////////////////////////////////////////////////////////
//:
//1. Customized
include "target.tmh"
include "Il2-46-u2nxt-warthog.ttm"
int main()
{
//Exclude non-existant devices
Exclude(&Joystick);
Exclude(&T16000);
Exclude(&LMFD);
Exclude(&RMFD);
if(Init(&EventHandle)) return 1;
SetKBRate(32, 50);
SetKBLayout(KB_ENG);
//Map Joystick Axis
MapAxis(&HCougar, JOYX, DX_X_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
SetSCurve(&HCougar, JOYX, 0, 0, 0, 0, 0);
MapAxis(&HCougar, JOYY, DX_Y_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
SetSCurve(&HCougar, JOYY, 0, 0, 0, 0, 0);
//Map Rudder Axis (through Cougar connector)
MapAxis(&HCougar, RUDDER, DX_Z_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
SetSCurve(&HCougar, RUDDER, 0, 0, 0, 0, 0);
//Now that Axis are mapped - setup EXEC for X,Y,Z Trim on S4
MapKeyIO(&HCougar, S4,
EXEC("TrimDXAxis(DX_Z_AXIS, SET(0)); TrimDXAxis(DX_X_AXIS, SET(0)); TrimDXAxis(DX_Y_AXIS, SET(0));"),
EXEC("LockDXAxis(DX_Z_AXIS, 1); LockDXAxis(DX_X_AXIS, 1); LockDXAxis(DX_Y_AXIS, 1);"
"TrimDXAxis(DX_Z_AXIS, CURRENT);TrimDXAxis(DX_X_AXIS, CURRENT); TrimDXAxis(DX_Y_AXIS, CURRENT);",
"LockDXAxis(DX_Z_AXIS, 0); LockDXAxis(DX_X_AXIS, 0); LockDXAxis(DX_Y_AXIS, 0);"));
//Map Old Cougar Throttle AXIS - now in Silver Box
MapAxis(&HCougar, THROTTLE, DX_XROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
SetSCurve(&HCougar, THROTTLE, 0, 0, 0, 0, 0);
//ANT_ELEV is NON-FUNTIONAL DUE TO KNOWN SOFTWARE BUG IN TARGET
//MapAxis(&HCougar, ANT_ELEV, 0, AXIS_NORMAL, MAP_ABSOLUTE);
//SetSCurve(&HCougar, ANT_ELEV, 0, 0, 0, 0, 0);
//KeyAxis(&HCougar, ANT_ELEV, 0, AXMAP1(8,PULSE+Cowl_or_Armor_Flaps_Rad,PULSE+Cowl_or_Armor_Flaps_Rad));
MapAxis(&HCougar, MAN_RNG, DX_YROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
SetSCurve(&HCougar, MAN_RNG, 0, 0, 0, 0, 0);
//Set Cougar Joystick S3 as U/D shift control AND Warthog Boat Switch as U/M/D Layers
//U/M/D Layers effect ONLY Weapons. BSF = U Layer while BSB = D Layer
//Boat Switch Back places Cannon on S2 switch (for fighters only0 - S2 = Cannon TG1 = MG
//Boat Switch Middle configures S2 to drop one bomb (unshifted or /U)
//Boat Switch Forward configures S2 to repeat bombs until S2 released
SetShiftButton(&HCougar, S3, &Throttle, BSF, BSB,0);
//Triggers on Cougar - Controlled by WARTHOG BOAT SWITCH
MapKeyIOUMD(&HCougar, TG1, Weapon_1, Weapon_1, Weapon_2, Weapon_1, Weapon_2, Weapon_1);
MapKeyIOUMD(&HCougar, TG2, Weapon_1, Weapon_1, 0, Weapon_1_2, 0, Weapon_1_2);
MapKeyIO(&HCougar, S1, PULSE+Toggle_Gunsight, PULSE+No_Cockpit_View);
MapKeyIOUMD(&HCougar, S2,
PULSE+Weapon_3, //Boat Switch Forward, S3 pressed and held Rockets - Switch Forward = "Release all Bombs"
REXEC(1, 40, "ActKey(KEYON+PULSE+Weapon_4);"), //Boat Switch Forward Bombs
PULSE+Weapon_3, //Boat Switch Middle, S3 pressed and held Rockets - Switch Middle = Normal - Single Bomb release per S2 actuation
PULSE+Weapon_4, //Boat Switch Middle Bombs
PULSE+Weapon_3, //Boat Switch Back, S3 pressed and held Rockets - Switch Back = Sturmjager mode. Wgfr-21 and Cannons
Weapon_2); //Boat Switch Back Cannon
//Hat1 - FINE TRIM NON REPEAT - small adjustments for work in concert with trim sliders - routine left in as option
//MapKeyIO(&HCougar, H1U, PULSE+Rudder_Trim_Neutral,PULSE+Elevator_Trim_Negative);
//MapKeyIO(&HCougar, H1D, PULSE+Aileron_Trim_Neutral, PULSE+Elevator_Trim_Positive);
//MapKeyIO(&HCougar, H1L, PULSE+Aileron_Trim_Left, PULSE+Rudder_Trim_Left);
//MapKeyIO(&HCougar, H1R, PULSE+Aileron_Trim_Right, PULSE+Rudder_Trim_Right);
//Hat1 - FINE TRIM REPEAT - Auto Fine Trim Routine
MapKeyIO(&HCougar, H1U,PULSE+Rudder_Trim_Neutral ,REXEC(2,60,"ActKey(KEYON+PULSE+Elevator_Trim_Negative);"));
MapKeyIO(&HCougar, H1D,PULSE+Aileron_Trim_Neutral, REXEC(3, 60, "ActKey(KEYON+PULSE+Elevator_Trim_Positive);"));
MapKeyIO(&HCougar, H1L,REXEC(4, 60, "ActKey(KEYON+PULSE+Aileron_Trim_Left);") ,REXEC(5,60,"ActKey(KEYON+PULSE+Rudder_Trim_Left);"));
MapKeyIO(&HCougar, H1R,REXEC(6, 60, "ActKey(KEYON+PULSE+Aileron_Trim_Right);"), REXEC(7, 60, "ActKey(KEYON+PULSE+Rudder_Trim_Right);"));
// Hat 2 - Unmapped - FOR COMMS
//Hat 3 - VIEWS
//Trackir Centre
MapKeyIO(&HCougar, H3U,External_View,Center_TrackIR);
//H3R Zoom View Sequence
MapKeyIOUMD(&HCougar, H3R, PULSE+Next_Friendly_View, SEQ( PULSE+Gunsight_Zoom_View, PULSE+Wide_View, PULSE+Normal_View), PULSE+Next_Friendly_View, SEQ( PULSE+Gunsight_Zoom_View, PULSE+Wide_View, PULSE+Normal_View), PULSE+Next_Friendly_View, SEQ( PULSE+Gunsight_Zoom_View, PULSE+Wide_View, PULSE+Normal_View));
//H3D Chase and "Six Checker" for enabled external views - 2nd Line is key release which returns view to cockpit
MapKeyIO(&HCougar, H3D, PULSE+Fly_by_View, PULSE+Chase_View);
MapKeyRIO(&HCougar, H3D, PULSE+Cockpit_View, PULSE+Cockpit_View);
//H3L Cockpit and External Enemy View
MapKeyIOUMD(&HCougar, H3L, PULSE+Next_Enemy_View, PULSE+Cockpit_View, PULSE+Next_Enemy_View, PULSE+Cockpit_View, PULSE+Next_Enemy_View, PULSE+Cockpit_View);
//Hat 4 - FLAPS/TAILWHEEL/CANOPY/CHOCKS
MapKeyIO(&HCougar, H4U, PULSE+Seat_Position, PULSE+Flaps_Up);
MapKeyIO(&HCougar, H4R, PULSE+Arresting_Hook, PULSE+Toggle_Canopy);
MapKeyIO(&HCougar, H4D, PULSE+Lock_Tail_Wheel, PULSE+Flaps_Down);
//Hat 4 Left unshifted is open - currently double assigned to Chocks
MapKeyIO(&HCougar, H4L, PULSE+Toggle_Chocks, PULSE+Toggle_Chocks);
//COUGAR THROTTLE - Transplanted to Project Box
//T2/3/4 are not assigned shifted values
MapKeyIO(&HCougar, T2, PULSE+Cockpit_Lights, PULSE+Cockpit_Lights);
MapKeyIO(&HCougar, T3, PULSE+Toggle_Mirrors, PULSE+Toggle_Mirrors);
MapKeyIO(&HCougar, T4, PULSE+Pilot_or_Gunner_Position, PULSE+Pilot_or_Gunner_Position);
//T5 is OPEN -
//T6 is PROP PITCH AUTO - with slider controlling prop pitch
MapKey(&HCougar, T6, PULSE+Prop_Pitch_Auto);
//Jettison Tanks/Stores and Emergency Switch
MapKeyIO(&HCougar, T7, PULSE+Fire_Extinguisher, PULSE+Jettison_Stores);
MapKeyIO(&HCougar, T8, PULSE+Bail_Out, PULSE+Jettison_Droptanks);
//Electric Prop Pitch Routine (HS-129)
MapKey(&HCougar, T10, REXEC(8, 50, "ActKey(KEYON+PULSE+Increase_Prop_Pitch);"));
MapKey(&HCougar, T9, REXEC(9, 50, "ActKey(KEYON+PULSE+Decrease_Prop_Pitch);"));
//WARTHOG THROTTLE
//MSP Switch = in flight Map toggle
MapKey(&Throttle, MSP, PULSE+Toggle_Map);
//SPDF Switch = Airbrake
MapKey(&Throttle, SPDF, PULSE+Airbrake);
//SPDB Switch (Momentary) = Wheel Brakes
MapKey(&Throttle, SPDB, PULSE+Wheel_Brakes);
//Coolie Switch Forward - Radiator *Note Il2 Radiator function only moves in one direction i.e. forward. This sequence is the only option for accessing AUTO Radiator function
//found in many aircraft. Mapping Radiator to a direct X rotary does not allow access to the "Auto" radiator function.
MapKey(&Throttle, CHF, Cowl_or_Armor_Flaps_Rad);
//Coolie Switch Back - Yes, duplicate of the forward position. This is in prepartion for Il2 "Cliffs of Dover" in which a more functional radiator is anticipated.
MapKey(&Throttle, CHB, Cowl_or_Armor_Flaps_Rad);
//Three Way switch on the left side of Throttle is setup to control external lights
MapKeyIOUMD(&Throttle, PSF, PULSE+Nav_Lights);
MapKeyIOUMD(&Throttle, PSB, PULSE+Landing_Lights);
//LTB is Engine Boost or WEP
MapKeyIOUMD(&Throttle, LTB, PULSE+Boost_WEP_Toggle);
//EFL Left and Right are setup as engine select switches - current setup is optimized for single and twin engine aircraft
MapKey(&Throttle, EFLNORM, PULSE+Select_Engine_1);
MapKey(&Throttle, EFRNORM, PULSE+Select_Engine_2);
//***MUST FIND BETTER USE OF THIS SWITCH - IN COD PROBABLY CARB HEAT
MapKey(&Throttle, APUON, PULSE+Boost_WEP_Toggle);
MapKey(&Throttle, APUOFF, PULSE+Boost_WEP_Toggle);
MapKeyR(&Throttle, APUOFF, PULSE+Boost_WEP_Toggle);
//Landing Gear
MapKeyIOUMD(&Throttle, LDGH, Landing_Gear_Toggle);
//Auto Manual Gear routine for aircraft with Manual Landing gear (I-16, F4F, etc)
MapKey(&Throttle, FLAPD, REXEC(10, 50, "ActKey(KEYON+PULSE+Lower_Gear_Manually);"));
MapKey(&Throttle, FLAPU, REXEC(11, 50, "ActKey(KEYON+PULSE+Raise_Gear_Manually);"));
MapKeyIOUMD(&Throttle, EACON, PULSE+L_CTL+'r', PULSE+L_CTL+'r', PULSE+L_CTL+'r', PULSE+L_CTL+'r', PULSE+L_CTL+'r', PULSE+L_CTL+'r');
MapKeyRIOUMD(&Throttle, EACON, PULSE+L_CTL+'r', PULSE+L_CTL+'r', PULSE+L_CTL+'r', PULSE+L_CTL+'r', PULSE+L_CTL+'r', PULSE+L_CTL+'r');
MapKeyIOUMD(&Throttle, APPAT, DOWN+L_SHIFT+'a', DOWN+L_SHIFT+'a', DOWN+L_SHIFT+'a', DOWN+L_SHIFT+'a', DOWN+L_SHIFT+'a', DOWN+L_SHIFT+'a');
MapKeyRIOUMD(&Throttle, APPAT, UP+L_SHIFT+'a', UP+L_SHIFT+'a', UP+L_SHIFT+'a', UP+L_SHIFT+'a', UP+L_SHIFT+'a', UP+L_SHIFT+'a');
MapKeyIOUMD(&Throttle, APALT, PULSE+',', PULSE+',', PULSE+',', PULSE+',', PULSE+',', PULSE+',');
MapKeyRIOUMD(&Throttle, APALT, PULSE+',', PULSE+',', PULSE+',', PULSE+',', PULSE+',', PULSE+',');
MapKeyIOUMD(&Throttle, EOLIGN, PULSE+'i', PULSE+'i', PULSE+'i', PULSE+'i', PULSE+'i', PULSE+'i');
MapKeyIOUMD(&Throttle, EORIGN, PULSE+'i', PULSE+'i', PULSE+'i', PULSE+'i', PULSE+'i', PULSE+'i');
MapKeyIOUMD(&Throttle, EFLOVER, PULSE+'5', PULSE+'5', PULSE+'5', PULSE+'5', PULSE+'5', PULSE+'5');
MapKeyIOUMD(&Throttle, EFROVER, PULSE+'6', PULSE+'6', PULSE+'6', PULSE+'6', PULSE+'6', PULSE+'6');
MapKeyIOUMD(&Throttle, EACOFF, PULSE+L_CTL+'r', PULSE+L_CTL+'r', PULSE+L_CTL+'r', PULSE+L_CTL+'r', PULSE+L_CTL+'r', PULSE+L_CTL+'r');
MapKeyRIOUMD(&Throttle, EACOFF, PULSE+L_CTL+'r', PULSE+L_CTL+'r', PULSE+L_CTL+'r', PULSE+L_CTL+'r', PULSE+L_CTL+'r', PULSE+L_CTL+'r');
MapKeyIOUMD(&Throttle, CSU, L_CTL+'3', L_CTL+'3', L_CTL+'3', L_CTL+'3', L_CTL+'3', L_CTL+'3');
MapKeyIOUMD(&Throttle, CSD, PULSE+L_CTL+'4', PULSE+L_CTL+'4', PULSE+L_CTL+'4', PULSE+L_CTL+'4', PULSE+L_CTL+'4', PULSE+L_CTL+'4');
MapKeyIOUMD(&Throttle, CSR, PULSE+L_CTL+'1', PULSE+L_CTL+'1', PULSE+L_CTL+'1', PULSE+L_CTL+'1', PULSE+L_CTL+'1', PULSE+L_CTL+'1');
MapKeyIOUMD(&Throttle, CSL, PULSE+L_CTL+'2', PULSE+L_CTL+'2', PULSE+L_CTL+'2', PULSE+L_CTL+'2', PULSE+L_CTL+'2', PULSE+L_CTL+'2');
MapAxis(&Throttle, SCX, 0, AXIS_NORMAL, MAP_ABSOLUTE);
SetSCurve(&Throttle, SCX, 0, 0, 0, 0, 0);
MapAxis(&Throttle, SCY, 0, AXIS_NORMAL, MAP_ABSOLUTE);
SetSCurve(&Throttle, SCY, 0, 0, 0, 0, 0);
MapAxis(&Throttle, THR_RIGHT, DX_THROTTLE_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
SetSCurve(&Throttle, THR_RIGHT, 0, 0, 0, 0, 0);
MapAxis(&Throttle, THR_LEFT, DX_ZROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
SetSCurve(&Throttle, THR_LEFT, 0, 0, 0, 0, 0);
MapAxis(&Throttle, THR_FC, DX_SLIDER_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
SetSCurve(&Throttle, THR_FC, 0, 0, 0, 0, 0);
}
int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);
}