Avec un grand grand merci à Dimebug et Ghostrider sans qui rien n'aurait été possible
include "target.tmh"
include "F4_keystrokes_Macros.ttm"
int main()
{
if(Init(&EventHandle))
return 1;
// declare the event handler, return on error
// Map key events
SetShiftButton(&Joystick, S3,&Throttle, BSB, BSM, BSF);
// define S3 as /I/O shift
// et BSF/BSM/BSB as /U/M/D
// BSB= Air/Air mode, BSM= Nav Mode, BSF= Air/Ground Mode
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);
MapAxis(&Throttle, SCX, DX_XROT_AXIS);
MapAxis(&Throttle, SCY, DX_YROT_AXIS, AXIS_REVERSED);
MapAxis(&Throttle, THR_FC, DX_SLIDER_AXIS);
SetJCurve(&Throttle, THR_LEFT,
80,
95);
//set rpm curve to match physical afterburner detent
SetJCurve(&Throttle, THR_RIGHT,
80,
95);
// Profil pour Falcon 4 par Mad Fly, Merci à DimeBug et Ghostrider chez qui j'ai piqué des morceaux de script
//Joystick------------------------------------------------------------------------------------------------------------------------
MapKey(&Joystick, S3,
'');
// Shift I/O
// Palette S4
MapKeyIO(&Joystick, S4, PULSE
+SimStepMasterArm, SimAPOverride);
// Cycle master arm / AP override
// gachette : 1 team speak, 2 tir cannon
MapKeyIO(&Joystick, TG1, L_ALT
+USB
[0x1F], R_CTL);
// Team Speak (RCtrl et Alt+2)
MapKey(&Joystick, TG2, SimTrigger);
// TG1 = uhf 1 / vhf 2, TG2 = cannon
// Joystick Switch
MapKeyIOUMD(&Joystick, S1,
'', PULSE
+SimNextAAWeapon,
// Changement armement AA
'', PULSE
+SimNextAGWeapon,
// Changement armement AG
PULSE
+SimFuelDoorToggle, PULSE
+SimMissileStep);
// Changement missile, Trappe fuel
MapKey(&Joystick, S2, SimPickle);
// Release Weapon
// HAT 1 Trim Hat + View
// Up
MapKeyIO(&Joystick, H1U, PULSE
+OTWSelectHUDMode, OTWViewUp);
// Fleche + Hud only (S3)
// Down
MapKeyIO(&Joystick, H1D, PULSE
+OTWSelect2DCockpitMode
,OTWViewDown);
// Fleche + Cockpit front (S3)
// Left
MapKeyIO(&Joystick, H1L, PULSE
+OTWToggleSidebar, OTWViewLeft);
// Fleche + Padlock SA bar (S3)
// Right
MapKeyIO(&Joystick, H1R, PULSE
+OTWSelectF3PadlockMode, OTWViewRight);
// Fleche + Padlock (S3)
// HAT 2 AA : ACM mode / Nav : ICP / AG weapons settings
// Up
MapKeyIOUMD(&Joystick, H2U,
SEQ
(PULSE
+SimSelectMRMOverride
,PULSE
+SimDeselectOverride),
// MRM Mode - Cancel missile mode
PULSE
+SimACM30x20,
// ACM 30x20
PULSE
+BombIntervalIncrement,
// Interval up
PULSE
+BombRippleIncrement,
// Ripple up
PULSE
+SimICPALOW,
// icp allow
PULSE
+SimICPDEDUP);
// icp cni up
// Down
MapKeyIOUMD(&Joystick, H2D,
SEQ
(PULSE
+SimSelectSRMOverride
,PULSE
+SimDeselectOverride),
// Dogfight Mode - Cancel missile mode
PULSE
+SimACMVertical,
// Acm Vertical
PULSE
+BombIntervalDecrement,
// Interval down
PULSE
+BombRippleDecrement,
// Ripple down
PULSE
+SimICPFAck,
// icp FACK
PULSE
+SimICPDEDDOWN);
// icp cni down
// Left
MapKeyIOUMD(&Joystick, H2L,
'',
//
PULSE
+SimACMSlew,
// Acm Slew
PULSE
+BombBurstDecrement,
// CBU alt down
PULSE
+BombPairRelease,
// drop pair
SEQ
(CHAIN
(PULSE
+SimICPResetDED, PULSE
+SimICPStpt),CHAIN
(PULSE
+SimICPResetDED, PULSE
+SimICPCrus),CHAIN
(PULSE
+SimICPResetDED, PULSE
+SimICPSIX),CHAIN
(PULSE
+SimICPResetDED, PULSE
+SimICPTILS)),
// icp steerpt - cruise - ILS
PULSE
+SimICPResetDED);
// icp cni rtn
// Right
MapKeyIOUMD(&Joystick, H2R,
'',
//
PULSE
+SimACMBoresight,
// Acm boresight
PULSE
+BombBurstIncrement,
// CBU alt up
PULSE
+BombSGLRelease,
// drop single
PULSE
+SimICPEnter,
// icp enter
PULSE
+SimICPDEDSEQ);
// icp cni seq
// HAT 3 Data Management
// Up
MapKeyIOUMD(&Joystick, H3U,
PULSE
+SimToggleMissileCage,
// uncage seeker head
PULSE
+SimRadarAAModeStep,
// cycle AA mode
PULSE
+SimMissileStep,
// mode CCIP CCRP DTOS
PULSE
+SimRadarAGModeStep,
// Cycle AG mode
PULSE
+SimDriftCO,
// drift CO
PULSE
+SimICPNext);
// icp increment
// Down
MapKeyIOUMD(&Joystick, H3D,
PULSE
+SimToggleMissileTDBPUncage,
// missile TD BP
PULSE
+USB
[0x41],
// cycle radar submode
PULSE
+SimRadarFreeze,
// Freeze GM
PULSE
+SimFCCSubModeStep,
// bomb mode
PULSE
+AFGearToggle,
// Gear up/down
PULSE
+SimICPPrevious);
// icp decrement
// Left
MapKeyIOUMD(&Joystick, H3L,
PULSE
+SimToggleMissileSpotScan,
// missile spot scan
PULSE
+SimSOIFOVStep,
// Expand
PULSE
+SimRadarFOVStep,
// GM field of view
PULSE
+SimMaverickFOVStep,
// TV field of view
PULSE
+SimHookToggle,
// hook
PULSE
+SimCATSwitch);
// cat switch
// Right
MapKeyIOUMD(&Joystick, H3R,
PULSE
+SimToggleMissileBoreSlave,
// msl bore slave
PULSE
+SimRadarBarScanChange,
// shift bar scan
PULSE
+SimRadarSnowplow,
// snowplow
PULSE
+SimToggleMissileCage,
// uncage AGM 65
PULSE
+SimLandingLightToggle,
// landing lights
PULSE
+SimExtlPower);
// master lights
// HAT 4 Counter measure Management + RWR
MapKey(&Joystick, H4U, SimDropFlare);
//Countermeasures Dispense
// Up
MapKeyIO(&Joystick, H4D, PULSE
+SimRWRSetTargetSep, PULSE
+SimRWRHandoff );
//RWR handoff + Target sep
// Left
MapKeyIO(&Joystick, H4L, PULSE
+SimEWSProgDec, PULSE
+SimCATSwitch );
// CAT I/III - EWS pgm dec
// Right
MapKeyIO(&Joystick, H4R, PULSE
+SimEWSProgInc, PULSE
+SimECMOn );
// ECM / EWS pgm inc
// Pushd
MapKeyIO(&Joystick, H4P, CHAIN
(PULSE
+SimEmergencyJettison
,PULSE
+SimCATSwitch),
'');
// Jettison all + Cat Switch
//Throttle-----------------------------------------------------------------------------------------------------------------------
// Left arm
//Pinky Switch
MapKey(&Throttle, PSF, CHAIN
(PULSE
+OTWSelect3DCockpitMode
,PULSE
+USB
[0x47]));
// Cockpit view + Track IR center (0x47 --> Scroll lock)
//MapKeyIO(&Throttle, PSM, ''); //
MapKey(&Throttle, PSB, PULSE
+OTWSelectOrbitMode);
//External view
//Left Throttle Button
MapKeyIO(&Throttle, LTB, PULSE
+AFDragChute
,SimWheelBrakes);
//Wheel Brake On , Dragging Chute (s4)
// Right Arm
//Slew Control
MapKeyIO(&Throttle, SC, PULSE
+SimDropTrack
,PULSE
+SimDesignate);
// Lock / unlock
//COOLIE Switch
// Up
MapKey(&Throttle, CSU, SimCursorUp);
//TDC Up
// Down
MapKey(&Throttle, CSD, SimCursorDown);
//TDC Down
// Left
MapKey(&Throttle, CSL, SimCursorLeft);
//TDC Left
// Right
MapKey(&Throttle, CSR, SimCursorRight);
//TDC Right
//MicSwitch
// Push
MapKey(&Throttle, MSP, SEQ
(PULSE
+SimDesignate
,PULSE
+SimDropTrack));
// Lock / unlock
// UP
MapKey(&Throttle, MSU, SimRadarElevationUp);
// Radar antenna Up
// Down
MapKey(&Throttle, MSD, SimRadarElevationDown);
// Radar antenna Dn
// Left
MapKeyIO(&Throttle, MSL
,PULSE
+OTWStepMFD3
,PULSE
+OTWStepMFD1);
// Left MFD + MFD3
// Right
MapKeyIO(&Throttle, MSR
,PULSE
+OTWStepMFD4, PULSE
+OTWStepMFD2);
// Right MFD + MFD4
//Speedbrake
MapKey(&Throttle, SPDB, AFBrakesToggle);
// Airbrake temporaire (commande relache)
MapKey(&Throttle, SPDM, PULSE
+AFBrakesIn);
// Aibrake Off
MapKey(&Throttle, SPDF, PULSE
+AFBrakesOut);
// Airbrake On
//Boat Switch
MapKey(&Throttle, BSB
,PULSE
+SimICPAA);
//Mode AA
MapKey(&Throttle, BSM
,PULSE
+SimICPNav);
//Mode Nav
MapKey(&Throttle, BSF
,PULSE
+SimICPAG);
//Mode AG
//China hat
MapKeyIO(&Throttle, CHB, PULSE
+SimHSDRangeStepDown, PULSE
+SimPrevWaypoint);
// HSD range dec / Prev stpt
MapKey(&Throttle, CHM,
'');
//
MapKeyIO(&Throttle, CHF, PULSE
+SimHSDRangeStepUp, PULSE
+SimNextWaypoint);
// HSD range inc / Next stpt
//Throttle base
//Engine panel
//Fuel
MapKey(&Throttle, EFLNORM, CHAIN
(PULSE
+SimExtlPower, D
(1000),PULSE
+SimLandingLightToggle, D
(1000), PULSE
+SimExtlSteady, D
(1000), PULSE
+SimExtlAntiColl, D
(1000), PULSE
+SimExtlWing));
// external Lights On off
MapKey(&Throttle, EFRNORM, PULSE
+SimInteriorLight);
// pit lights on off
MapKey(&Throttle, EFLOVER, CHAIN
(PULSE
+SimExtlPower, D
(1000),PULSE
+SimLandingLightToggle, D
(1000), PULSE
+SimExtlSteady, D
(1000), PULSE
+SimExtlAntiColl, D
(1000), PULSE
+SimExtlWing));
// external Lights On off
MapKey(&Throttle, EFROVER, PULSE
+SimInteriorLight);
// pit lights on off
//Eng Oper
// Left
MapKey(&Throttle, EOLIGN, PULSE
+SimFuelDump);
// Dump fuel
//MapKeyIO(&Throttle, EOLNORM, PULSE+R_ALT+USB[0x00]);
MapKey(&Throttle, EOLMOTOR, PULSE
+SimFuelDoorToggle);
// Fuel door
// Right
MapKey(&Throttle, EORIGN
,PULSE
+SimEmergencyJettison );
// Jettison Weapons
//MapKeyIO(&Throttle, EORNORM, PULSE+R_CTL+USB[0x00]);
MapKey(&Throttle, EORMOTOR, PULSE
+SimLaserArmToggle);
// Laser on off
//APU Start
MapKey(&Throttle, APUON, PULSE
+AFGearUp);
// gear Up !!!! F4 AF only
MapKey(&Throttle, APUOFF, PULSE
+AFGearDown);
// gear down !!! F4 AF only
//L/G Wrn
MapKey(&Throttle, LDGH, SEQ
(PULSE
+R_CTL
+USB
[0x06],PULSE
+SimWarnReset));
//reset Warn
//FLAP
MapKey(&Throttle, FLAPU, PULSE
+SimAVTRSwitch);
// Record ACMI
MapKey(&Throttle, FLAPM, PULSE
+SimAVTRSwitchBack);
//ACMI Record off
MapKey(&Throttle, FLAPD, PULSE
+ToggleNVGMode);
// Night vision goggle
//Autopilot Panel
//EAC
MapKey(&Throttle, EACON, PULSE
+SimRadarStandby);
// Radar on off
MapKey(&Throttle, EACOFF, PULSE
+SimRadarStandby);
//
//RDR ALTM
MapKey(&Throttle, RDRNRM, PULSE
+SimRALTON);
// Radar alt on
MapKey(&Throttle, RDRDIS, PULSE
+SimRALTSTDBY);
// Radar alt Standby
//Autopilot
MapKey(&Throttle, APENG, CHAIN
(LOCK
+PULSE
+RadioAWACSCommand
,LOCK
+PULSE
+USB
[0x26],LOCK
+SimEject));
// Eject + Awacs information
MapKey(&Throttle, APPAT, PULSE
+SimLeftAPSwitch);
//Autopilot Left
//MapKeyIO(&Throttle, APAH, PULSE+L_ALT+USB[0x26]); //Autopilot disengage
MapKey(&Throttle, APALT, PULSE
+SimRightAPSwitch);
//Autopilot Right
//Idle detent //
//Left
//MapKeyIO(&Throttle, IDLELON, PULSE+R_ALT+USB[0x4d]); //Left engine Stop
//MapKeyIO(&Throttle, IDLELOFF, PULSE+USB[0x00]);
//Right
//MapKeyIO(&Throttle, IDLERON, PULSE+R_CTL+USB[0x4d]); //Right engine Stop
//MapKeyIO(&Throttle, IDLEROFF, PULSE+USB[0x00]);
//Left MFD
MapKey(&LMFD, OSB01, PULSE
+L_CTL
+L_ALT
+USB
[0x1E]);
MapKey(&LMFD, OSB02, PULSE
+L_CTL
+L_ALT
+USB
[0x1F]);
MapKey(&LMFD, OSB03, PULSE
+L_CTL
+L_ALT
+USB
[0x20]);
MapKey(&LMFD, OSB04, PULSE
+L_CTL
+L_ALT
+USB
[0x21]);
MapKey(&LMFD, OSB05, PULSE
+L_CTL
+L_ALT
+USB
[0x22]);
MapKey(&LMFD, OSB06, PULSE
+L_CTL
+L_ALT
+USB
[0x23]);
MapKey(&LMFD, OSB07, PULSE
+L_CTL
+L_ALT
+USB
[0x24]);
MapKey(&LMFD, OSB08, PULSE
+L_CTL
+L_ALT
+USB
[0x25]);
MapKey(&LMFD, OSB09, PULSE
+L_CTL
+L_ALT
+USB
[0x26]);
MapKey(&LMFD, OSB10, PULSE
+L_CTL
+L_ALT
+USB
[0x27]);
MapKey(&LMFD, OSB11, PULSE
+L_CTL
+L_ALT
+USB
[0x59]);
MapKey(&LMFD, OSB12, PULSE
+L_CTL
+L_ALT
+USB
[0x5A]);
MapKey(&LMFD, OSB13, PULSE
+L_CTL
+L_ALT
+USB
[0x5B]);
MapKey(&LMFD, OSB14, PULSE
+L_CTL
+L_ALT
+USB
[0x5C]);
MapKey(&LMFD, OSB15, PULSE
+L_CTL
+L_ALT
+USB
[0x5D]);
MapKey(&LMFD, OSB16, PULSE
+L_CTL
+L_ALT
+USB
[0x5E]);
MapKey(&LMFD, OSB17, PULSE
+L_CTL
+L_ALT
+USB
[0x5F]);
MapKey(&LMFD, OSB18, PULSE
+L_CTL
+L_ALT
+USB
[0x60]);
MapKey(&LMFD, OSB19, PULSE
+L_CTL
+L_ALT
+USB
[0x61]);
MapKey(&LMFD, OSB20, PULSE
+L_CTL
+L_ALT
+USB
[0x62]);
MapKey(&LMFD, GAINU,
'');
MapKey(&LMFD, GAIND,
'');
MapKey(&LMFD, SYMU,
'');
MapKey(&LMFD, SYMD,
'');
MapKey(&LMFD, BRTU, PULSE
+L_CTL
+L_ALT
+USB
[0x0A]);
MapKey(&LMFD, BRTD, PULSE
+L_CTL
+L_ALT
+USB
[0x09]);
MapKey(&LMFD, CONU,
'');
MapKey(&LMFD, COND,
'');
//Right MFD
MapKey(&RMFD, OSB01, PULSE
+L_SHIFT
+L_ALT
+USB
[0x1E]);
MapKey(&RMFD, OSB02, PULSE
+L_SHIFT
+L_ALT
+USB
[0x1F]);
MapKey(&RMFD, OSB03, PULSE
+L_SHIFT
+L_ALT
+USB
[0x20]);
MapKey(&RMFD, OSB04, PULSE
+L_SHIFT
+L_ALT
+USB
[0x21]);
MapKey(&RMFD, OSB05, PULSE
+L_SHIFT
+L_ALT
+USB
[0x22]);
MapKey(&RMFD, OSB06, PULSE
+L_SHIFT
+L_ALT
+USB
[0x23]);
MapKey(&RMFD, OSB07, PULSE
+L_SHIFT
+L_ALT
+USB
[0x24]);
MapKey(&RMFD, OSB08, PULSE
+L_SHIFT
+L_ALT
+USB
[0x25]);
MapKey(&RMFD, OSB09, PULSE
+L_SHIFT
+L_ALT
+USB
[0x26]);
MapKey(&RMFD, OSB10, PULSE
+L_SHIFT
+L_ALT
+USB
[0x27]);
MapKey(&RMFD, OSB11, PULSE
+L_SHIFT
+L_ALT
+USB
[0x59]);
MapKey(&RMFD, OSB12, PULSE
+L_SHIFT
+L_ALT
+USB
[0x5A]);
MapKey(&RMFD, OSB13, PULSE
+L_SHIFT
+L_ALT
+USB
[0x5B]);
MapKey(&RMFD, OSB14, PULSE
+L_SHIFT
+L_ALT
+USB
[0x5C]);
MapKey(&RMFD, OSB15, PULSE
+L_SHIFT
+L_ALT
+USB
[0x5D]);
MapKey(&RMFD, OSB16, PULSE
+L_SHIFT
+L_ALT
+USB
[0x5E]);
MapKey(&RMFD, OSB17, PULSE
+L_SHIFT
+L_ALT
+USB
[0x5F]);
MapKey(&RMFD, OSB18, PULSE
+L_SHIFT
+L_ALT
+USB
[0x60]);
MapKey(&RMFD, OSB19, PULSE
+L_SHIFT
+L_ALT
+USB
[0x61]);
MapKey(&RMFD, OSB20, PULSE
+L_SHIFT
+L_ALT
+USB
[0x62]);
MapKey(&RMFD, GAINU,
'');
MapKey(&RMFD, GAIND,
'');
MapKey(&RMFD, SYMU,
'');
MapKey(&RMFD, SYMD,
'');
MapKey(&RMFD, BRTU, PULSE
+L_SHIFT
+L_ALT
+USB
[0x0A]);
MapKey(&RMFD, BRTD, PULSE
+L_SHIFT
+L_ALT
+USB
[0x09]);
MapKey(&RMFD, CONU,
'');
MapKey(&RMFD, COND,
'');
}
int EventHandle
(int type,
alias o,
int x)
{
DefaultMapping(&o, x);
}