include "target.tmh" char route_mode_active = 0; char cannon_active = 0; //program startup int main() { // Exclude Cougar MFDs, they're pure DX devices Configure(&LMFD, MODE_EXCLUDED); Configure(&RMFD, MODE_EXCLUDED); if(Init(&EventHandle)) return 1; // declare the event handler, return on error MapAxis(&Joystick, JOYX, DX_X_AXIS); MapAxis(&Joystick, JOYY, DX_Y_AXIS); MapAxis(&Throttle, THR_LEFT, DX_Z_AXIS); MapAxis(&Throttle, SCX, DX_XROT_AXIS); MapAxis(&Throttle, SCY, DX_YROT_AXIS); MapAxis(&HCougar, RUDDER, DX_THROTTLE_AXIS); // Set LED backlighting to lowest (visible) level ActKey(PULSE+KEYON+LED(&Throttle, LED_INTENSITY, 45)); // Set (only) LED 1 to on for this profile ActKey(PULSE + KEYON + LED(&Throttle, LED_ONOFF, LED_CURRENT + LED1)); ActKey(PULSE + KEYON + LED(&Throttle, LED_ONOFF, LED_CURRENT - LED2)); ActKey(PULSE + KEYON + LED(&Throttle, LED_ONOFF, LED_CURRENT - LED3)); ActKey(PULSE + KEYON + LED(&Throttle, LED_ONOFF, LED_CURRENT - LED4)); ActKey(PULSE + KEYON + LED(&Throttle, LED_ONOFF, LED_CURRENT - LED5)); // Assign zoom control to gray throttle friction lever //KeyAxis(&Throttle, THR_FC, 0 , AXMAP2(LIST(0,40,60,100), Zoom_in_slow, 0, Zoom_out_slow)); // Cyclic Stick = Joystick // Trigger1 = Cannon/Release Weapon MapKey(&Joystick, TG1, EXEC("if (cannon_active) ActKey(KEYON + SPC); else ActKey(R_ALT + KEYON + SPC);")); MapKeyR(&Joystick, TG1, EXEC("if (cannon_active) ActKey(SPC); else ActKey(R_ALT + SPC);")); MapKey(&Joystick, S1, CHAIN( PULSE + 'c', EXEC("cannon_active = !cannon_active;"))); // Toggle Cannon Trigger/Release Weapon Trigger MapKey(&Joystick, S2, 'o'); // Uncage Shkval MapKey(&Joystick, S3, L_ALT + 't'); // Toggle Auto Hover MapKey(&Joystick, S4, 'w'); // Wheel brake // Hat1 Short = AP // Hat1 Long = Targeting/HMS MapKey(&Joystick, H1U, TEMPO(PULSE + L_CTL + 'a', PULSE + L_SHIFT + 'a', 250)); // Toggle Flight Director Mode / AP Alt Hold MapKey(&Joystick, H1R, TEMPO(PULSE + L_SHIFT + 'b', PULSE + 'q', 250)); // AP Bank Hold / Auto turn to target MapKey(&Joystick, H1D, TEMPO(PULSE + L_SHIFT + 'p', PULSE + 'h', 250)); // AP Pitch Hold / HMS MapKey(&Joystick, H1L, PULSE + L_SHIFT + 'h'); // AP Heading Hold // TMS = Targeting Control Panel MapKey(&Joystick, H2U, PULSE + L_ALT + 's'); // Airborne Head-On Target MapKey(&Joystick, H2R, PULSE + 'n'); // Ground Moving Target MapKey(&Joystick, H2D, PULSE + 'v'); // Airborne Target MapKey(&Joystick, H2L, PULSE + 'p'); // Autmatic Tracking / Gun Sight // DMS = Shkval slew control MapKey(&Joystick, H3U, '.'); MapKey(&Joystick, H3R, '/'); MapKey(&Joystick, H3D, ';'); MapKey(&Joystick, H3L, ','); MapKey(&Joystick, H4U, 't'); // Trimmer MapKey(&Joystick, H4R, PULSE + INS); // UV 26 Start program MapKey(&Joystick, H4L, PULSE + DEL); // UV 26 Stop program // Collective Stick = Throttle // Pinky Switch = Cockpit Light / Anti Collision Beacon Light MapKey(&Throttle, PSF, PULSE + 'k'); MapKey(&Throttle, PSB, PULSE + R_SHIFT + 'j'); // Left Throttle Button // Short: Collective Brake // Long (>= 2 Seconds): Jettison stores + expedite ATGMs MapKey(&Throttle, LTB, TEMPO(PULSE + 'f', CHAIN( PULSE + L_ALT + 'r', D(50), LOCK + DOWN + R_CTL + 'w', D(450), UP + R_CTL + 'w', LOCK, D(150), LOCK + DOWN + R_CTL + 'w', D(450), UP + R_CTL + 'w', LOCK, D(150), LOCK + DOWN + R_CTL + 'w', D(450), UP + R_CTL + 'w', LOCK, D(150), LOCK + DOWN + R_CTL + 'w', D(450), UP + R_CTL + 'w', LOCK, D(150), LOCK + DOWN + R_CTL + 'w', D(450), UP + R_CTL + 'w', LOCK), 2000)); // Throttle Slew Control: Slew Search Light //KeyAxis(&Throttle, SCX, 0, AXMAP2(3, R_CTL + ',', 0, R_CTL + '/')); //KeyAxis(&Throttle, SCY, 0, AXMAP2(3, R_CTL + ';', 0, R_CTL + '.')); // Throttle Slew Control Push: Lock Target MapKey(&Throttle, SC, ENT); // Throttle Coolie Switch = Hardpoint selection MapKey(&Throttle, CSU, BSP); // Reset Targeting MapKey(&Throttle, CSR, 'y'); MapKey(&Throttle, CSD, 'u'); MapKey(&Throttle, CSL, 'i'); // Throttle Mic Switch = SPU9 Selector + Transmit MapKey(&Throttle, MSR, PULSE + L_CTL + L_ALT + '/'); MapKey(&Throttle, MSD, PULSE + R_ALT + '\\'); //MapKey(&Throttle, MSL, 'c'); //MapKey(&Throttle, MSU, 'd'); // Speedbrake = Route mode/Descent mode MapKey(&Throttle, SPDF, CHAIN( PULSE + 'r', EXEC("route_mode_active = 1;"))); MapKey(&Throttle, SPDM, CHAIN( EXEC("if (route_mode_active) ActKey(PULSE + KEYON + 'r');"), EXEC("route_mode_active = 0;"))); MapKey(&Throttle, SPDB, 'd'); // Boat Switch: Free Rotor RPM MapKey(&Throttle, BSF, '['); MapKey(&Throttle, BSB, ']'); // China Hat: // Short: Shkval FOV/Zoom // Long: Shkval tracking gate size increase/decrease MapKey(&Throttle, CHF, PULSE + '='); MapKey(&Throttle, CHB, PULSE + '-'); // Throttle Base // EAC = K-041 Targeting System MapKey(&Throttle, EACON, PULSE + L_SHIFT + 'd'); MapKey(&Throttle, EACOFF, PULSE + L_SHIFT + 'd'); // Radar Altimeter = Free Turbine (Low/Nominal) RPM MapKey(&Throttle, RDRNRM, PULSE + R_ALT + USB[0x57]); MapKey(&Throttle, RDRDIS, PULSE + R_ALT + USB[0x56]); // LASTE Autopilot Engage = Engine Start MapKey(&Throttle, APENG, PULSE + HOME); // LASTE Autopilot Mode Selector = Laser Stdby/Off MapKey(&Throttle, APPAT, PULSE + R_SHIFT + 'o'); MapKey(&Throttle, APALT, PULSE + R_SHIFT + 'o'); // Landing Gear Horn Silencer = Engine Selector MapKey(&Throttle, LDGH, 'e'); // APU OFF = APU shutdown :) MapKey(&Throttle, APUOFF, PULSE + END); // Engine Operate Left/Right Ignite = Cutoff valve left/right MapKey(&Throttle, EOLIGN, PULSE + R_CTL + PGUP); MapKey(&Throttle, EORIGN, PULSE + R_CTL + PGDN); } //event handler int EventHandle(int type, alias o, int x) { DefaultMapping(&o, x); //add event handling code here }