Publié : mar. avr. 26, 2011 10:41 pm
par dimebug
un vieux profil Target (a retester) si tu as des problemes MP moi
Il faut activer les touches avionic dans le soft config de vrs:
include "target.tmh"
int main() // initialize the physical devices and create the virtual devices
{
if(Init(&EventHandle)) return 1; // declare the event handler, return on error
// Map key events
SetShiftButton(&Joystick, S4, &Throttle, BSF, BSM, BSB); // define S3 as /I/O switch, BSF/BSM/BSB as /U/M/D switch
//Real to virtual axis mapping
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);
MapAxis(&Throttle, THR_FC, DX_SLIDER_AXIS);
// Centered Axis Curves (joystick, axis, left_deadzone, center_deadzone, right_deadzone, curve, scale)
SetSCurve(&Joystick, JOYX, 0, 0, 0, 0, 0);
SetSCurve(&Joystick, JOYY, 0, 0, 0, 0, 0);
SetSCurve(&Throttle, SCX, 0, 15, 0, 0, 0);
SetSCurve(&Throttle, SCY, 0, 15, 0, 0, 0);
SetSCurve(&Throttle, THR_FC, 0, 0, 0, 0, 0);
// Slider axis Curves ((joystick, axis, % travelvalue, desired axis value);
SetJCurve(&Throttle, THR_LEFT, 50, 50); //50% of the physical range as 50% of the axis value = linear
SetJCurve(&Throttle, THR_RIGHT, 50, 50);
SetShiftButton(&Joystick, S3); // define S3 as /I/O shift
//Joystick------------------------------------------------------------------------------------------------------------------------
MapKey(&Joystick, TG1, PULSE+L_SHIFT+L_CTL+USB[0x19]); // Fire Gun
MapKeyR(&Joystick,TG1, PULSE+L_SHIFT+L_CTL+USB[0x19]); // Stop Fire Gun
MapKeyIO(&Joystick, TG2, 0);
// Joystick Switch
MapKeyIO(&Joystick, S1, L_SHIFT+DEL); //Undesignate
MapKeyIO(&Joystick, S2, L_SHIFT+L_CTL+USB[0x06]); //Fire Weapon
//MapKeyIO(&Joystick, S3, L_SHIFT+DEL); // use as shift buton, will not generate a keystroke
MapKeyIO(&Joystick, S4, DEL); //Undesignate
// HAT 1
MapKeyIO(&Joystick, H1U, DXHATUP, R_CTL+USB[0x37]); // /O DX Hat /I Trim UP
MapKeyIO(&Joystick, H1D, DXHATDOWN, R_CTL+USB[0x33]); // /O DX Hat /I Trim Down
MapKeyIO(&Joystick, H1L, DXHATLEFT, R_CTL+USB[0x36]); // /O DX Hat /I Trim Left
MapKeyIO(&Joystick, H1R, DXHATRIGHT, R_CTL+USB[0x38]); // /O DX Hat /I Trim Right
// HAT 2
MapKeyIO(&Joystick, H2U, L_CTL+USB[0x52]); //TDC priority ACM Mode BST
MapKeyIO(&Joystick, H2D, L_CTL+USB[0x51]); //TDC priority ACM Mode VACQ
MapKeyIO(&Joystick, H2L, L_CTL+USB[0x50]); //TDC priority ACM Mode WACQ
MapKeyIO(&Joystick, H2R, L_CTL+USB[0x4F]); //TDC priority ACM Mode AACQ
// HAT 3
MapKeyIO(&Joystick, H3U, L_SHIFT+L_CTL+USB[0x1E]); //AA weapon select1
MapKeyIO(&Joystick, H3D, L_SHIFT+L_CTL+USB[0x20]); //AA weapon select3
MapKeyIO(&Joystick, H3L, L_SHIFT+L_CTL+USB[0x1F]); //AA weapon select2
MapKeyIO(&Joystick, H3R, L_SHIFT+L_CTL+USB[0x21]); //AA weapon select4
// HAT 4
MapKeyIO(&Joystick, H4U, 'd');
MapKeyIO(&Joystick, H4D, 'd');
MapKeyIO(&Joystick, H4L, 'd');
MapKeyIO(&Joystick, H4R, 'd');
MapKeyIO(&Joystick, H4P, 'd');
//Throttle-----------------------------------------------------------------------------------------------------------------------
// Left arm
//Pinky Switch
MapKeyIO(&Throttle, PSF, PULSE+L_SHIFT+USB[0x10]); //lights all
MapKeyIO(&Throttle, PSM, PULSE+L_SHIFT+USB[0x10]); //Light all
MapKeyIO(&Throttle, PSB, PULSE+L_SHIFT+USB[0x10]); //Light all
//Left Throttle Button
MapKeyIO(&Throttle, LTB, USB[0x1A], L_CTL+USB[0x15]); //Autopilot-Autothrottle
// Right Arm
//Slew Control
MapKeyIO(&Throttle, SC, USB[0x28], L_SHIFT+USB[0x4C]); //Lock-unlock
//COOLIE Switch
MapKey(&Throttle, CSU, L_SHIFT+USB[0x52]); //Radar elevation&azimut
MapKey(&Throttle, CSD, L_SHIFT+USB[0x51]); //
MapKey(&Throttle, CSL, L_SHIFT+USB[0x50]); //
MapKey(&Throttle, CSR, L_SHIFT+USB[0x4F]); //
//MicSwitch
MapKeyIO(&Throttle, MSP, PULSE+L_SHIFT+USB[0x0E]); //ALE47Power Toggle
MapKeyIO(&Throttle, MSU, PULSE+USB[0x07]); //dispense
MapKeyIO(&Throttle, MSD, PULSE+USB[0x07]); //dispense
MapKeyIO(&Throttle, MSL, PULSE+USB[0x09]); //Flare
MapKeyIO(&Throttle, MSR, PULSE+USB[0x06]); //Chaff
//Speedbrake
MapKeyIO(&Throttle, SPDF, USB[0x37]); //Speedbrake
MapKeyIO(&Throttle, SPDM, PULSE+USB[0x37]);
MapKeyIO(&Throttle, SPDB, USB[0x37]);
//Boat Switch
MapKeyIO(&Throttle, BSF, PULSE+L_SHIFT+L_CTL+USB[0x23]); //AA mastermode
MapKeyIO(&Throttle, BSM, PULSE+L_SHIFT+L_CTL+USB[0x22]); //NAV mastermode
MapKeyIO(&Throttle, BSB, PULSE+L_SHIFT+L_CTL+USB[0x24]); //AG Mastermode
//China hat
MapKeyIO(&Throttle, CHF, PULSE+L_CTL+USB[0x18]); //Cage/uncage
MapKeyIO(&Throttle, CHM, 0);
MapKeyIO(&Throttle, CHB, PULSE+L_CTL+USB[0x18]); //Cage/uncage
//Throttle base
//Engine panel
//Fuel
MapKeyIO(&Throttle, EFLNORM, PULSE+'q');
MapKeyIO(&Throttle, EFRNORM, PULSE+'q');
MapKeyIO(&Throttle, EFLOVER, PULSE+'q');
MapKeyIO(&Throttle, EFROVER, PULSE+'q');
//Eng Oper
MapKeyIO(&Throttle, EOLIGN, PULSE+'q');
MapKeyIO(&Throttle, EOLNORM, PULSE+'q');
MapKeyIO(&Throttle, EOLMOTOR, PULSE+'q');
MapKeyIO(&Throttle, EORIGN, PULSE+'q');
MapKeyIO(&Throttle, EORNORM, PULSE+'q');
MapKeyIO(&Throttle, EORMOTOR, PULSE+'q');
//APU Start
MapKeyIO(&Throttle, APUON, PULSE+USB[0x0A], PULSE+USB[0x0B]); //Landing Gear / hook
MapKeyIO(&Throttle, APUOFF, PULSE+USB[0x0A], PULSE+USB[0x0B]);
//L/G Wrn
MapKeyIO(&Throttle, LDGH, PULSE+L_CTL+USB[0x10]); //Mastercaution Reset
//FLAP
MapKey(&Throttle, FLAPU, PULSE+USB[0x3E]); //Flaps UP
MapKeyR(&Throttle, FLAPU,PULSE+USB[0x40]);
//MapKeyIO(&Throttle, FLAPM, PULSE+USB[0x40]); //Flaps Half
MapKey(&Throttle, FLAPD, PULSE+USB[0x41]); //Flap Full
MapKeyR(&Throttle,FLAPD, PULSE+USB[0x3F]);
//Autopilot Panel
//EAC
MapKeyIO(&Throttle, EACON, PULSE+L_CTL+USB[0x14]); //Master Arm
MapKeyIO(&Throttle, EACOFF, PULSE+L_CTL+USB[0x14]);
//RDR ALTM
MapKeyIO(&Throttle, RDRNRM, PULSE+'q');
MapKeyIO(&Throttle, RDRDIS, PULSE+'q');
//Autopilot
MapKeyIO(&Throttle, APENG, PULSE+USB[0x04]); //AP on
MapKeyIO(&Throttle, APPAT, PULSE+L_CTL+USB[0x11]); //AP nav mode
MapKeyIO(&Throttle, APAH, PULSE+L_CTL+USB[0x0B]); //AP heading holdww
MapKeyIO(&Throttle, APALT, PULSE+L_CTL+USB[0x17]); //ap alt mode
//Idle detent
//Left
MapKeyIO(&Throttle, IDLELON, PULSE+L_SHIFT+L_CTL+USB[0x07]); //idle
MapKeyIO(&Throttle, IDLELOFF, PULSE+L_SHIFT+L_CTL+USB[0x07]);
//Right
MapKeyIO(&Throttle, IDLERON, PULSE+L_SHIFT+L_CTL+USB[0x07]); //idle
MapKeyIO(&Throttle, IDLEROFF, PULSE+L_SHIFT+L_CTL+USB[0x07]);
//Left MFD
MapKey(&LMFD, OSB01, CHAIN(PULSE+L_CTL+USB[0x50],D(50),USB[0x23])); //DDI-UFCD-OSB06
MapKey(&LMFD, OSB02, CHAIN(PULSE+L_CTL+USB[0x50],D(50),USB[0x24])); //DDI-UFCD-OSB07
MapKey(&LMFD, OSB03, CHAIN(PULSE+L_CTL+USB[0x50],D(50),USB[0x25])); //DDI-UFCD-OSB08
MapKey(&LMFD, OSB04, CHAIN(PULSE+L_CTL+USB[0x50],D(50),USB[0x26])); //DDI-UFCD-OSB09
MapKey(&LMFD, OSB05, CHAIN(PULSE+L_CTL+USB[0x50],D(50),USB[0x27])); //DDI-UFCD-OSB10
MapKey(&LMFD, OSB06, CHAIN(PULSE+L_CTL+USB[0x50],D(50),L_CTL+USB[0x1E])); //DDI-UFCD-OSB11
MapKey(&LMFD, OSB07, CHAIN(PULSE+L_CTL+USB[0x50],D(50),L_CTL+USB[0x1F])); //DDI-UFCD-OSB12
MapKey(&LMFD, OSB08, CHAIN(PULSE+L_CTL+USB[0x50],D(50),L_CTL+USB[0x20])); //DDI-UFCD-OSB13
MapKey(&LMFD, OSB09, CHAIN(PULSE+L_CTL+USB[0x50],D(50),L_CTL+USB[0x21])); //DDI-UFCD-OSB14
MapKey(&LMFD, OSB10, CHAIN(PULSE+L_CTL+USB[0x50],D(50),L_CTL+USB[0x22])); //DDI-UFCD-OSB15
MapKey(&LMFD, OSB11, CHAIN(PULSE+L_CTL+USB[0x50],D(50),L_CTL+USB[0x23])); //DDI-UFCD-OSB16
MapKey(&LMFD, OSB12, CHAIN(PULSE+L_CTL+USB[0x50],D(50),L_CTL+USB[0x24])); //DDI-UFCD-OSB17
MapKey(&LMFD, OSB13, CHAIN(PULSE+L_CTL+USB[0x50],D(50),L_CTL+USB[0x25])); //DDI-UFCD-OSB18
MapKey(&LMFD, OSB14, CHAIN(PULSE+L_CTL+USB[0x50],D(50),L_CTL+USB[0x26])); //DDI-UFCD-OSB19
MapKey(&LMFD, OSB15, CHAIN(PULSE+L_CTL+USB[0x50],D(50),L_CTL+USB[0x27])); //DDI-UFCD-OSB20
MapKeyIO(&LMFD, OSB16, CHAIN(PULSE+L_CTL+USB[0x50],D(50),USB[0x1E])); //DDI-UFCD-OSB01
MapKeyIO(&LMFD, OSB17, CHAIN(PULSE+L_CTL+USB[0x50],D(50),USB[0x1F])); //DDI-UFCD-OSB02
MapKeyIO(&LMFD, OSB18, CHAIN(PULSE+L_CTL+USB[0x50],D(50),USB[0x20])); //DDI-UFCD-OSB03
MapKeyIO(&LMFD, OSB19, CHAIN(PULSE+L_CTL+USB[0x50],D(50),USB[0x21])); //DDI-UFCD-OSB04
MapKeyIO(&LMFD, OSB20, CHAIN(PULSE+L_CTL+USB[0x50],D(50),USB[0x22])); //DDI-UFCD-OSB05
MapKey(&LMFD, GAINU, 0);
MapKey(&LMFD, GAIND, 0);
MapKey(&LMFD, SYMU, 0);
MapKey(&LMFD, SYMD, 0);
MapKey(&LMFD, BRTU, 0);
MapKey(&LMFD, BRTD, 0);
MapKey(&LMFD, CONU, 0);
MapKey(&LMFD, COND, 0);
//Right MFD
MapKey(&RMFD, OSB01, CHAIN( PULSE+L_CTL+USB[0x4F],D(50),USB[0x23])); //DDI-UFCD-OSB06
MapKey(&RMFD, OSB02, CHAIN( PULSE+L_CTL+USB[0x4F],D(50),USB[0x24])); //DDI-UFCD-OSB07
MapKey(&RMFD, OSB03, CHAIN( PULSE+L_CTL+USB[0x4F],D(50),USB[0x25])); //DDI-UFCD-OSB08
MapKey(&RMFD, OSB04, CHAIN( PULSE+L_CTL+USB[0x4F],D(50),USB[0x26])); //DDI-UFCD-OSB09
MapKey(&RMFD, OSB05, CHAIN( PULSE+L_CTL+USB[0x4F],D(50),USB[0x27])); //DDI-UFCD-OSB10
MapKey(&RMFD, OSB06, CHAIN( PULSE+L_CTL+USB[0x4F],D(50),L_CTL+USB[0x1E])); //DDI-UFCD-OSB11
MapKey(&RMFD, OSB07, CHAIN( PULSE+L_CTL+USB[0x4F],D(50),L_CTL+USB[0x1F])); //DDI-UFCD-OSB12
MapKey(&RMFD, OSB08, CHAIN( PULSE+L_CTL+USB[0x4F],D(50),L_CTL+USB[0x20])); //DDI-UFCD-OSB13
MapKey(&RMFD, OSB09, CHAIN( PULSE+L_CTL+USB[0x4F],D(50),L_CTL+USB[0x21])); //DDI-UFCD-OSB14
MapKey(&RMFD, OSB10, CHAIN( PULSE+L_CTL+USB[0x4F],D(50),L_CTL+USB[0x22])); //DDI-UFCD-OSB15
MapKey(&RMFD, OSB11, CHAIN( PULSE+L_CTL+USB[0x4F],D(50),L_CTL+USB[0x23])); //DDI-UFCD-OSB16
MapKey(&RMFD, OSB12, CHAIN( PULSE+L_CTL+USB[0x4F],D(50),L_CTL+USB[0x24])); //DDI-UFCD-OSB17
MapKey(&RMFD, OSB13, CHAIN( PULSE+L_CTL+USB[0x4F],D(50),L_CTL+USB[0x25])); //DDI-UFCD-OSB18
MapKey(&RMFD, OSB14, CHAIN( PULSE+L_CTL+USB[0x4F],D(50),L_CTL+USB[0x26])); //DDI-UFCD-OSB19
MapKey(&RMFD, OSB15, CHAIN( PULSE+L_CTL+USB[0x4F],D(50),L_CTL+USB[0x27])); //DDI-UFCD-OSB20
MapKey(&RMFD, OSB16, CHAIN( PULSE+L_CTL+USB[0x4F],D(50),USB[0x1E])); //DDI-UFCD-OSB01
MapKey(&RMFD, OSB17, CHAIN( PULSE+L_CTL+USB[0x4F],D(50),USB[0x1F])); //DDI-UFCD-OSB02
MapKey(&RMFD, OSB18, CHAIN( PULSE+L_CTL+USB[0x4F],D(50),USB[0x20])); //DDI-UFCD-OSB03
MapKey(&RMFD, OSB19, CHAIN( PULSE+L_CTL+USB[0x4F],D(50),USB[0x21])); //DDI-UFCD-OSB04
MapKey(&RMFD, OSB20, CHAIN( PULSE+L_CTL+USB[0x4F],D(50),USB[0x22])); //DDI-UFCD-OSB05
MapKey(&RMFD, GAINU, 0);
MapKey(&RMFD, GAIND, 0);
MapKey(&RMFD, SYMU, 0);
MapKey(&RMFD, SYMD, 0);
MapKey(&RMFD, BRTU, 0);
MapKey(&RMFD, BRTD, 0);
MapKey(&RMFD, CONU, 0);
MapKey(&RMFD, COND, 0);
}
int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);
}