SCRIPTS TARGET TM WARTHOG etc
Publié : mar. nov. 23, 2010 11:16 pm
post dédié aux questions concernant le langage de scripts
La simulation de vol de combat
https://ts.checksix-fr.com/
[déplacé]dimebug a écrit :Pour bien gérer la souris avec le slew, il suffis de jouer sur la sensibilité de celle ci avec le paramètre "zoom" sous la GUI (essayes -5 pour commencer)
en script il faudra jouer sur le meme parametre avec une commande qui retouche la reponse des axes : SetScurve
SetSCurve(&Throttle, SCX, 0, 25, 0, 0, -5);
SetSCurve(&Throttle, SCY, 0, 25, 0, 0, -5);
[déplacé]SV_DIDIER69 a écrit :0,25,0,0,-5, c'est injouable, c'est la vitesse de la lumière pour la souris, quel est le paramètre là dedans qui influe sur la vitesse de déplacement, c'est l e -5 ? dois je le mettre a -25 ou a + 20, je vais essayer les deux tiens!
[déplacé]SV_DIDIER69 a écrit :Je viens d'essayer avec 0,25,0,-1,-25 et miracle elles est toute caline la souris, un peu trop, je vais remonter un peu. c'est bien le 5° paramètre qui influe sur la vitesse.
Code : Tout sélectionner
[color=Cyan]DEF H1UR[/color] [color=Yellow]NOT([/color] H1U [color=Lime]OR [/color]H1R[color=Yellow]) AND ([/color]H1U [color=Lime]AND [/color]H1R[color=Yellow])[/color]
Code : Tout sélectionner
if !(Joystick[H1U] | Joystick[H1R]) & (Joystick[H1U] & Joystick[H1R]) REXEC(0, 250, ActKey(PULSE+Camera_snap_view_up_right));
Code : Tout sélectionner
include "target.tmh"
//include "BS_Snapviews.ttm"
int main()
{
if(Init(&EventHandle)) return 1;
char H1UR, H1DR, H1DL, H1UL;
H1UR = !(Joystick[H1U] | Joystick[H1R]) & (Joystick[H1U] & Joystick[H1R]);
H1DR = !(Joystick[H1D] | Joystick[H1R]) & (Joystick[H1D] & Joystick[H1R]);
H1DL = !(Joystick[H1D] | Joystick[H1L]) & (Joystick[H1D] & Joystick[H1L]);
H1UR = !(Joystick[H1U] | Joystick[H1L]) & (Joystick[H1U] & Joystick[H1L]);
// attribue les mouvements de la camera au HAT1 pour définir les snapviews
if(H1UR) REXEC(0, 250, ActKey(PULSE+Camera_snap_view_up_right));
if(H1UL) REXEC(0, 250, ActKey(PULSE+Camera_snap_view_up_left));
if(H1DR) REXEC(0, 250, ActKey(PULSE+Camera_snap_view_down_right));
if(H1DL) REXEC(0, 250, ActKey(PULSE+Camera_snap_view_down_left));
}
int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);
}
Code : Tout sélectionner
[color=#ffd700][B]include[/B][/color] [color=#f0e68c]"target.tmh"[/color];
[color=#ffd700][B]include[/B][/color] [color=#f0e68c]"FC2_KA_50_Macros.ttm"[/color];
[color=#ffd700][B]int[/B][/color] main()
{
[color=#ffd700][B]if[/B][/color][color=#00ffff]([/color]Init(&EventHandle)) [color=#ffd700][B]return[/B][/color] [color=#191970]1[/color];
[color=#90ee90]// définit les positions centrales des HAT [/color]
[color=#ffd700][B]char[/B][/color] H1M, H2M, H3M, H4M, MSM, CSM;
H1M = !(Joystick[color=#00ffff][[/color]H1U] | Joystick[color=#00ffff][[/color]H1D] | Joystick[color=#00ffff][[/color]H1L] | Joystick[color=#00ffff][[/color]H1R]);
H2M = !(Joystick[color=#00ffff][[/color]H2U] | Joystick[color=#00ffff][[/color]H2D] | Joystick[color=#00ffff][[/color]H2L] | Joystick[color=#00ffff][[/color]H2R]);
H3M = !(Joystick[color=#00ffff][[/color]H3U] | Joystick[color=#00ffff][[/color]H3D] | Joystick[color=#00ffff][[/color]H3L] | Joystick[color=#00ffff][[/color]H3R]);
H4M = !(Joystick[color=#00ffff][[/color]H4U] | Joystick[color=#00ffff][[/color]H4D] | Joystick[color=#00ffff][[/color]H4L] | Joystick[color=#00ffff][[/color]H4R]);
MSM = !(Throttle[color=#00ffff][[/color]MSU] | Throttle[color=#00ffff][[/color]MSD] | Throttle[color=#00ffff][[/color]MSL] | Throttle[color=#00ffff][[/color]MSR]);
CSM = !(Throttle[color=#00ffff][[/color]CSU] | Throttle[color=#00ffff][[/color]CSD] | Throttle[color=#00ffff][[/color]CSL] | Throttle[color=#00ffff][[/color]CSR]);
[color=#90ee90]// définit les positions diagonales des HAT[/color]
[color=#ffd700][B]char[/B][/color] H1UR, H1DR, H1DL, H1UL, H1M;
H1UR = !(Joystick[color=#00ffff][[/color]H1U] | Joystick[color=#00ffff][[/color]H1R]) & (Joystick[color=#00ffff][[/color]H1U] & Joystick[color=#00ffff][[/color]H1R]);
H1DR = !(Joystick[color=#00ffff][[/color]H1D] | Joystick[color=#00ffff][[/color]H1R]) & (Joystick[color=#00ffff][[/color]H1D] & Joystick[color=#00ffff][[/color]H1R]);
H1DL = !(Joystick[color=#00ffff][[/color]H1D] | Joystick[color=#00ffff][[/color]H1L]) & (Joystick[color=#00ffff][[/color]H1D] & Joystick[color=#00ffff][[/color]H1L]);
H1UR = !(Joystick[color=#00ffff][[/color]H1U] | Joystick[color=#00ffff][[/color]H1L]) & (Joystick[color=#00ffff][[/color]H1U] & Joystick[color=#00ffff][[/color]H1L]);
[color=#ffd700][B]char[/B][/color] H2UR, H2DR, H2DL, H2UL;
H2UR = !(Joystick[color=#00ffff][[/color]H2U] | Joystick[color=#00ffff][[/color]H2R]) & (Joystick[color=#00ffff][[/color]H2U] & Joystick[color=#00ffff][[/color]H2R]);
H2DR = !(Joystick[color=#00ffff][[/color]H2D] | Joystick[color=#00ffff][[/color]H2R]) & (Joystick[color=#00ffff][[/color]H2D] & Joystick[color=#00ffff][[/color]H2R]);
H2DL = !(Joystick[color=#00ffff][[/color]H2D] | Joystick[color=#00ffff][[/color]H2L]) & (Joystick[color=#00ffff][[/color]H2D] & Joystick[color=#00ffff][[/color]H2L]);
H2UR = !(Joystick[color=#00ffff][[/color]H2U] | Joystick[color=#00ffff][[/color]H2L]) & (Joystick[color=#00ffff][[/color]H2U] & Joystick[color=#00ffff][[/color]H2L]);
[color=#ffd700][B]char[/B][/color] H3UR, H3DR, H3DL, H3UL;
H3UR = !(Joystick[color=#00ffff][[/color]H3U] | Joystick[color=#00ffff][[/color]H3R]) & (Joystick[color=#00ffff][[/color]H3U] & Joystick[color=#00ffff][[/color]H3R]);
H3DR = !(Joystick[color=#00ffff][[/color]H3D] | Joystick[color=#00ffff][[/color]H3R]) & (Joystick[color=#00ffff][[/color]H3D] & Joystick[color=#00ffff][[/color]H3R]);
H3DL = !(Joystick[color=#00ffff][[/color]H3D] | Joystick[color=#00ffff][[/color]H3L]) & (Joystick[color=#00ffff][[/color]H3D] & Joystick[color=#00ffff][[/color]H3L]);
H3UR = !(Joystick[color=#00ffff][[/color]H3U] | Joystick[color=#00ffff][[/color]H3L]) & (Joystick[color=#00ffff][[/color]H3U] & Joystick[color=#00ffff][[/color]H3L]);
[color=#ffd700][B]char[/B][/color] H4UR, H4DR, H4DL, H4UL;
H4UR = !(Joystick[color=#00ffff][[/color]H4U] | Joystick[color=#00ffff][[/color]H4R]) & (Joystick[color=#00ffff][[/color]H4U] & Joystick[color=#00ffff][[/color]H4R]);
H4DR = !(Joystick[color=#00ffff][[/color]H4D] | Joystick[color=#00ffff][[/color]H4R]) & (Joystick[color=#00ffff][[/color]H4D] & Joystick[color=#00ffff][[/color]H4R]);
H4DL = !(Joystick[color=#00ffff][[/color]H4D] | Joystick[color=#00ffff][[/color]H4L]) & (Joystick[color=#00ffff][[/color]H4D] & Joystick[color=#00ffff][[/color]H4L]);
H4UR = !(Joystick[color=#00ffff][[/color]H4U] | Joystick[color=#00ffff][[/color]H4L]) & (Joystick[color=#00ffff][[/color]H4U] & Joystick[color=#00ffff][[/color]H4L]);
[color=#ffd700][B]char[/B][/color] MSUR, MSDR, MSDL, MSUL;
MSUR = !(Joystick[color=#00ffff][[/color]MSU] | Joystick[color=#00ffff][[/color]MSR]) & (Joystick[color=#00ffff][[/color]MSU] & Joystick[color=#00ffff][[/color]MSR]);
MSDR = !(Joystick[color=#00ffff][[/color]MSD] | Joystick[color=#00ffff][[/color]MSR]) & (Joystick[color=#00ffff][[/color]MSD] & Joystick[color=#00ffff][[/color]MSR]);
MSDL = !(Joystick[color=#00ffff][[/color]MSD] | Joystick[color=#00ffff][[/color]MSL]) & (Joystick[color=#00ffff][[/color]MSD] & Joystick[color=#00ffff][[/color]MSL]);
MSUR = !(Joystick[color=#00ffff][[/color]MSU] | Joystick[color=#00ffff][[/color]MSL]) & (Joystick[color=#00ffff][[/color]MSU] & Joystick[color=#00ffff][[/color]MSL]);
[color=#ffd700][B]char[/B][/color] CSUR, CSDR, CSDL, CSUL;
CSUR = !(Joystick[color=#00ffff][[/color]CSU] | Joystick[color=#00ffff][[/color]CSR]) & (Joystick[color=#00ffff][[/color]CSU] & Joystick[color=#00ffff][[/color]CSR]);
CSDR = !(Joystick[color=#00ffff][[/color]CSD] | Joystick[color=#00ffff][[/color]CSR]) & (Joystick[color=#00ffff][[/color]CSD] & Joystick[color=#00ffff][[/color]CSR]);
CSDL = !(Joystick[color=#00ffff][[/color]CSD] | Joystick[color=#00ffff][[/color]CSL]) & (Joystick[color=#00ffff][[/color]CSD] & Joystick[color=#00ffff][[/color]CSL]);
CSUR = !(Joystick[color=#00ffff][[/color]CSU] | Joystick[color=#00ffff][[/color]CSL]) & (Joystick[color=#00ffff][[/color]CSU] & Joystick[color=#00ffff][[/color]CSL]);
REXEC[color=#00ffff]([/color][color=#191970]0[/color], [color=#191970]25[/color], [color=#f0e68c]"if(H1UR) ActKey(KEYON+'U');if(H1M) ActKey(KEYON+'M');"[/color], RNOSTOP);
}
[color=#ffd700][B]int[/B][/color] EventHandle[color=#00ffff]([/color][color=#ffd700][B]int[/B][/color] type, [color=#ffd700][B]alias[/B][/color] o, [color=#ffd700][B]int[/B][/color] x)
{
DefaultMapping(&o, x);
}
Code : Tout sélectionner
char timer, timer_duree, timer_intervalle;
timer = 0;
timer_duree = 1000;
timer_intervalle = 2000;
if(!timer) DeferCall(timer_intervalle, EXEC("timer=1;"));
if(timer) DeferCall(timer_duree, EXEC("timer=0;");
Code : Tout sélectionner
[color=#ffd700][B]include[/B][/color] [color=#f0e68c]"target.tmh"[/color];
[color=#ffd700][B]include[/B][/color] [color=#f0e68c]"FC2_KA_50_Macros.ttm"[/color];
[color=#ffd700][B]int[/B][/color] timer_on;
[color=#ffd700][B]int[/B][/color] main()
{
[color=#ffd700][B]if[/B][/color][color=#00ffff]([/color]Init(&EventHandle)) [color=#ffd700][B]return[/B][/color] [color=#191970]1[/color];
[color=#ffd700][B]char[/B][/color] timer, timer_intervalle, timer_duree;
timer = [color=#191970]0[/color];
timer_intervalle = [color=#191970]400[/color];
timer_duree = [color=#191970]600[/color];
REXEC[color=#00ffff]([/color][color=#191970]1[/color], timer_intervalle, EXEC([color=#f0e68c]"timer_on"[/color]), RNOSTOP);
timer_on = CHAIN(
EXEC([color=#f0e68c]"timer = 1;"[/color]),
REXEC[color=#00ffff]([/color][color=#191970]0[/color], timer_duree, EXEC([color=#f0e68c]"timer = 0;"[/color]), RNOSTOP),
StopAutoRepeat[color=#00ffff]([/color][color=#191970]0[/color])
);
}
[color=#ffd700][B]int[/B][/color] EventHandle[color=#00ffff]([/color][color=#ffd700][B]int[/B][/color] type, [color=#ffd700][B]alias[/B][/color] o, [color=#ffd700][B]int[/B][/color] x)
{
DefaultMapping(&o, x);
}
dimebug a écrit :voila la solution
si la trigger 1 a été pressé brièvement, un appuis sur S2 genere un F
Si la TG1 a été pressé + de 400 millisecondes, un appuis sur S2 genere un V
include "target.tmh";
char longpress;
int main()
{
if(Init(&EventHandle)) return 1;
longpress = 0; //set longpress flag to none
//si Tg1 est pressé + de 400 millisecondes, le flag longpress devient vrai, si pressé moins de 400 mls, le flag est faux
MapKey(&Joystick, TG1, TEMPO(EXEC("longpress=0;"), EXEC("longpress=1;"), 400));
//si longpress est vrai, generer un v, sinon generer un f quand je presse S2
MapKey(&Joystick, S2, EXEC("if(longpress) ActKey(PULSE+KEYON+'v'); else ActKey(PULSE+KEYON+'f');"));
}
int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);
}
Code : Tout sélectionner
include "target.tmh"
[color=Yellow]
alias T160001; [/color] [color=Yellow]// descripteur pour le second T16000 utilisé pour mapper les axes.[/color] [color=Yellow]A ajouter manuellement[/color]
int main()
{
if(Init(&EventHandle)) return 1;
[color=Yellow]&T160001 = GetIndexJoy(SelectUsbDevice("VID_044F&PID_B10A"));
// recherche un second T16000 sur les ports USB[/color] [color=Yellow];
//A ajouter manuellement[/color] [color=Yellow](cf code initial dans target.tmh)[/color]
[color=Yellow]//Pour d'autres périphériques, voir dans le sous dossier Target\DevCfg
// ou chercher dans le gestionnaire de périphériques, Propriétés, Hardware tab,
// selectionner le hardware, puis propriétés, puis details, et dans la liste déroulante
// Propriétés selectionner numero d'identification de périphérique correspondant
// ou voir dans registry à la clé HKLM\system\currentcontrolset\enum\USB[/color]
MapAxis(&T16000, JOYX, MOUSE_X_AXIS);
MapAxis(&T16000, JOYY, MOUSE_Y_AXIS);
[color=Yellow] MapAxis(&T160001, JOYX, MOUSE_X_AXIS); // il faut ajouter ces 2 lignes manuellement
MapAxis(&T160001, JOYY, MOUSE_Y_AXIS);[/color]
}
int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);
}
Code : Tout sélectionner
include "target.tmh"
alias SaitekThrottle;
int main()
{
if(Init(&EventHandle)) return 1;
&SaitekThrottle1 = GetIndexJoy(SelectUsbDevice("vid_06a3&pid_0c2d"));
// recherche un SaitekThrottle sur les ports USB ;
MapAxis(&SaitekThrottle1, JOYX, MOUSE_X_AXIS); // il faut ajouter ces 2 lignes manuellement
MapAxis(&SaitekThrottle1, JOYY, MOUSE_Y_AXIS);
}
int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);
}
ils sont sectaires hein ! ?
Compile Succeeded.
Physical USB HID devices managed by script!
Currently plugged USB HID devices[4]:
1: "Throttle - HOTAS Warthog" - "USB\VID_044F&PID_0404&REV_0100"
2: "Joystick - HOTAS Warthog" - "USB\VID_044F&PID_0402&REV_0100"
3: "F16 MFD 1" - "USB\VID_044F&PID_B351&REV_0100"
4: "F16 MFD 2" - "USB\VID_044F&PID_B352&REV_0100"
USB HID device "Throttle - HOTAS Warthog"(USB\VID_044F&PID_0404\6&79A1627&0&7) selected
USB HID device "Joystick - HOTAS Warthog"(USB\VID_044F&PID_0402\6&79A1627&0&3) selected
USB HID device "F16 MFD 1"(USB\VID_044F&PID_B351\6&307B2F89&0&4) selected
USB HID device "F16 MFD 2"(USB\VID_044F&PID_B352\6&307B2F89&0&3) selected
USB HID device with hardware id "VID_044F&PID_0400" cannot be found
USB HID device with hardware id "VID_044F&PID_B10A" cannot be found
Virtual HID devices managed by script!
Connecting virtual joystick...Done
Device name set to Thrustmaster Combined
Connecting virtual keyboard...Done
Connecting virtual mouse...Done
Cannot use "vid_06a3&pid_0c2d"
T.A.R.G.E.T is supporting only Thrustmaster devices!
NB : le message d'erreur "Symbol not found : pulse line 13" apparait si PULSE+ est saisi en minuscule pulse+include "target.tmh";
include "FC2_KA_50_Macros.ttm";
int main()
{
if(Init(&EventHandle)) return 1;
SetShiftButton(&Joystick, S3, &Throttle, PSF, PSB);
// appui S1 => selection mode canon
// appui Shift bouton (S3) + S1 bref => selection activation de tous les pylones armement
// appui Shift bouton (S3) + S1 > 400 msec => selection alternative des pylones armement extérieurs ou intérieurs
MapKeyIO(&Joystick, S1,[INDENT][INDENT]TEMPO((PULSE+Weapon_selection_all_stations), [INDENT][INDENT]SEQ(PULSE+Weapon_selection_outward_stations,
[/INDENT][INDENT][INDENT]PULSE+Weapon_selection_inward_stations),
[/INDENT][/INDENT]400),
[/INDENT]PULSE+Gun_Select);
[/INDENT][/INDENT]}
int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);
}
Code : Tout sélectionner
MapKey(&Joystick, TX2, [color=#191970]0[/color]);
alors que c'est l'exacte copie du premier exemple de manuel target script 1.3 p14/56 ?Symbol not found: TX2
ça marche impec
include "target.tmh";
include "FC2_KA_50_Macros.ttm";
int main()
{
if(Init(&EventHandle)) return 1;
// ABRIS section on LMFD
MapKey(&LMFD, OSB11, ABRIS_Button_5)
MapKey(&LMFD, OSB12, ABRIS_Button_4)
MapKey(&LMFD, OSB13, ABRIS_Button_3)
MapKey(&LMFD, OSB14, ABRIS_Button_2)
MapKey(&LMFD, OSB15, ABRIS_Button_1)
MapKey(&LMFD, OSB10, TEMPO((PULSE+ABRIS_Axis_Push), (PULSE+ABRIS_Power), 1000)) // appui long (1 sec pour allumer et eteindre ABRIS
MapKey(&LMFD, BRTU, ABRIS_Brightness_Increase)
MapKey(&LMFD, BRTD, ABRIS_Brightness_Decrease)
MapKey(&LMFD, CONU, ABRIS_Axis_Increase)
MapKey(&LMFD, COND, ABRIS_Axis_Decrease)
}
int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);
}
ça marche impec
include "target.tmh";
include "FC2_KA_50_Macros.ttm";
char mode_R800;
int main()
{
if(Init(&EventHandle)) return 1;
// R800 section activée par appui maintenu du OSB01 sur le RMFD
mode_R800=0;
MapKey(&RMFD, OSB01, EXEC("mode_R800=1;"));
MapKeyR(&RMFD, OSB01, EXEC("mode_R800=0;"));
MapKey(&RMFD, GAINU, REXEC(01, 300, "if(mode_R800) ActKey(PULSE+KEYON+R_800_Rotary_1_Up);"));
MapKey(&RMFD, GAIND, REXEC(01, 300, "if(mode_R800) ActKey(PULSE+KEYON+R_800_Rotary_1_Down);"));
MapKey(&RMFD, BRTU, REXEC(01, 300, "if(mode_R800) ActKey(PULSE+KEYON+R_800_Rotary_2_Up);"));
MapKey(&RMFD, BRTD, REXEC(01, 300, "if(mode_R800) ActKey(PULSE+KEYON+R_800_Rotary_2_Down);"));
MapKey(&RMFD, SYMU, REXEC(01, 300, "if(mode_R800) ActKey(PULSE+KEYON+R_800_Rotary_3_Up);"));
MapKey(&RMFD, SYMD, REXEC(01, 300, "if(mode_R800) ActKey(PULSE+KEYON+R_800_Rotary_3_Down);"));
MapKey(&RMFD, CONU, REXEC(01, 300, "if(mode_R800) ActKey(PULSE+KEYON+R_800_Rotary_4_Up);"));
MapKey(&RMFD, COND, REXEC(01, 300, "if(mode_R800) ActKey(PULSE+KEYON+R_800_Rotary_4_Down);"));
}
int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);
}
include "target.tmh";
include "FC2_KA_50_Macros.ttm";
//
// flags pour les modes des MFDs
// RMFD
char mode_RMFD_IT23, mode_RMFD_NVG, mode_RMFD_ABRIS, mode_RMFD_HUD, mode_RMFD_R828, mode_RMFD_ADF;
char mode_RMFD_Light_AuxPanel, mode_RMFD_Light_PitPanel, mode_RMFD_Light_HSIADI, mode_RMFD_Light_PitNVG;
char mode_RMFD_R800_Chanels, mode_RMFD_R800;
// LMFD
char mode_LMFD_Clock, mode_LMFD_HSI, mode_LMFD_RadAlt, mode_LMFD_ADI, mode_LMFD_QFE;
//
int main()
{
if(Init(&EventHandle)) return 1;
//
// initialisation des flags
// RMFD
mode_RMFD_IT23=0;
mode_RMFD_NVG=0;
mode_RMFD_ABRIS=0;
mode_RMFD_HUD=0;
mode_RMFD_R828=0;
mode_RMFD_ADF=0;
mode_RMFD_Light_AuxPanel=0;
mode_RMFD_Light_PitPanel=0;
mode_RMFD_Light_HSIADI=0;
mode_RMFD_Light_PitNVG=0;
mode_RMFD_R800=0;
mode_RMFD_R800_Chanels=0;
// LMFD
mode_LMFD_Clock=0;
mode_LMFD_HSI=0;
mode_LMFD_RadAlt=0;
mode_LMFD_ADI=0;
mode_LMFD_QFE=0;
//
// ==========================***** début section MFDS *****==============================
//
// ****** RIGHT MFD section ********
//
// R-828 VHF-1 avec OSB20 sur RMFD
MapKey(&RMFD, OSB20, EXEC("mode_RMFD_R828=1;"));
MapKeyR(&RMFD, OSB20, EXEC("mode_RMFD_R828=0;"));
MapKey(&RMFD, GAINU, REXEC(91, 300, "if(mode_RMFD_R828) ActKey(PULSE+KEYON+Volume_up);"));
MapKey(&RMFD, GAIND, REXEC(90, 300, "if(mode_RMFD_R828) ActKey(PULSE+KEYON+Volume_down);"));
MapKey(&RMFD, CONU, REXEC(89, 300, "if(mode_RMFD_R828) ActKey(PULSE+KEYON+Channel_selector_next);"));
MapKey(&RMFD, COND, REXEC(88, 300, "if(mode_RMFD_R828) ActKey(PULSE+KEYON+Channel_selector_previous);"));
MapKey(&RMFD, SYMU, REXEC(87, 300, "if(mode_RMFD_R828) ActKey(PULSE+KEYON+Tuner_button);"));
MapKey(&RMFD, SYMD, REXEC(86, 300, "if(mode_RMFD_R828) ActKey(PULSE+KEYON+R_828_Squelch);"));
// HUD brightness avec OSB19 sur RMFD
MapKey(&RMFD, OSB19, EXEC("mode_RMFD_HUD=1;"));
MapKeyR(&RMFD, OSB19, EXEC("mode_RMFD_HUD=0;"));
MapKey(&RMFD, BRTU, REXEC(85, 300, "if(mode_RMFD_HUD) ActKey(PULSE+KEYON+HUD_Brightness_up);"));
MapKey(&RMFD, BRTD, REXEC(84, 300, "if(mode_RMFD_HUD) ActKey(PULSE+KEYON+HUD_Brightness_down);"));
MapKey(&RMFD, GAINU, REXEC(83, 300, "if(mode_RMFD_HUD) ActKey(PULSE+KEYON+HUD_Modes_Reticle_Night_Day);"));
MapKey(&RMFD, GAIND, REXEC(82, 300, "if(mode_RMFD_HUD) ActKey(PULSE+KEYON+Raise_Lower_Colour_Filter_On_HUD);"));
MapKey(&RMFD, SYMU, REXEC(81, 300, "if(mode_RMFD_HUD) ActKey(PULSE+KEYON+HUD_Test);"));
// NVG brightness avec OSB18 sur RMFD
MapKey(&RMFD, OSB18, EXEC("mode_RMFD_NVG=1;"));
MapKeyR(&RMFD, OSB18, EXEC("mode_RMFD_NVG=0;"));
MapKey(&RMFD, BRTU, REXEC(80, 300, "if(mode_RMFD_NVG) ActKey(PULSE+KEYON+Helmet_device_brightness_Up);"));
MapKey(&RMFD, BRTD, REXEC(79, 300, "if(mode_RMFD_NVG) ActKey(PULSE+KEYON+Helmet_device_brightness_Down);"));
// IT23 Shkval screen avec OSB17 sur RFMD
MapKey(&RMFD, OSB17, EXEC("mode_RMFD_IT23=1;"));
MapKeyR(&RMFD, OSB17, EXEC("mode_RMFD_IT23=0;"));
MapKey(&RMFD, BRTU, REXEC(78, 300, "if(mode_RMFD_IT23) ActKey(PULSE+KEYON+IT_23_brightness_Up);"));
MapKey(&RMFD, BRTD, REXEC(77, 300, "if(mode_RMFD_IT23) ActKey(PULSE+KEYON+IT_23_brightness_Down);"));
MapKey(&RMFD, CONU, REXEC(76, 300, "if(mode_RMFD_IT23) ActKey(PULSE+KEYON+IT_23_contrast_Up);"));
MapKey(&RMFD, COND, REXEC(75, 300, "if(mode_RMFD_IT23) ActKey(PULSE+KEYON+IT_23_contrast_Down);"));
MapKey(&RMFD, SYMU, EXEC("if(mode_RMFD_IT23) ActKey(PULSE+KEYON+IT_23_Black_White_indication_switch);"));
// ABRIS mode RMFD OSB16
MapKey(&RMFD, OSB16, EXEC("mode_RMFD_ABRIS=1;"));
MapKeyR(&RMFD, OSB16, EXEC("mode_RMFD_ABRIS=0;"));
MapKey(&RMFD, BRTU, REXEC(74, 300, "if(mode_RMFD_ABRIS) ActKey(PULSE+KEYON+ABRIS_Brightness_Increase);"));
MapKey(&RMFD, BRTD, REXEC(73, 300, "if(mode_RMFD_ABRIS) ActKey(PULSE+KEYON+ABRIS_Brightness_Decrease);"));
MapKey(&RMFD, SYMU, EXEC("if(mode_RMFD_ABRIS) ActKey(PULSE+KEYON+ABRIS_Power);"));
// ADF mode RMFD OSB15
MapKey(&RMFD, OSB15, EXEC("mode_RMFD_ADF=1;"));
MapKeyR(&RMFD, OSB15, EXEC("mode_RMFD_ADF=0;"));
MapKey(&RMFD, GAINU, REXEC(72, 300, "if(mode_RMFD_ADF) ActKey(PULSE+KEYON+ADF_Volume_up);"));
MapKey(&RMFD, GAIND, REXEC(71, 300, "if(mode_RMFD_ADF) ActKey(PULSE+KEYON+ADF_Volume_down);"));
MapKey(&RMFD, CONU, REXEC(70, 300, "if(mode_RMFD_ADF) ActKey(PULSE+KEYON+ADF_Channel_next);"));
MapKey(&RMFD, COND, REXEC(69, 300, "if(mode_RMFD_ADF) ActKey(PULSE+KEYON+ADF_Channel_prevous);"));
MapKey(&RMFD, SYMU, REXEC(68, 300, "if(mode_RMFD_ADF) ActKey(PULSE+KEYON+ADF_Mode_change);"));
MapKey(&RMFD, SYMD, REXEC(67, 300, "if(mode_RMFD_ADF) ActKey(PULSE+KEYON+ADF_Receiver_mode_change);"));
MapKey(&RMFD, BRTU, REXEC(66, 300, "if(mode_RMFD_ADF) ActKey(PULSE+KEYON+ADF_Self_test);"));
// OSB14
// OSB13
// OSB12
// OSB11
// Light Aux Panel on RMFD with OSB10
MapKey(&RMFD, OSB10, EXEC("mode_RMFD_Light_AuxPanel=1;"));
MapKeyR(&RMFD, OSB10, EXEC("mode_RMFD_Light_AuxPanel=0;"));
MapKey(&RMFD, BRTU, REXEC(65, 300, "if(mode_RMFD_Light_AuxPanel) ActKey(PULSE+KEYON+Lighting_auxiliary_panel_brightness_knob__Up);"));
MapKey(&RMFD, BRTD, REXEC(64, 300, "if(mode_RMFD_Light_AuxPanel) ActKey(PULSE+KEYON+Lighting_auxiliary_panel_brightness_knob_Down);"));
// Light Pit Panel on RMFD with OSB09
MapKey(&RMFD, OSB09, EXEC("mode_RMFD_Light_PitPanel=1;"));
MapKeyR(&RMFD, OSB09, EXEC("mode_RMFD_Light_PitPanel=0;"));
MapKey(&RMFD, BRTU, REXEC(63, 300, "if(mode_RMFD_Light_PitPanel) ActKey(PULSE+KEYON+Lighting_cockpit_panel_brightness_knob_Up);"));
MapKey(&RMFD, BRTD, REXEC(62, 300, "if(mode_RMFD_Light_PitPanel) ActKey(PULSE+KEYON+Lighting_cockpit_panel_brightness_knob_Down);"));
// Light HSI ADI on RMFD with OSB08
MapKey(&RMFD, OSB08, EXEC("mode_RMFD_Light_HSIADI=1;"));
MapKeyR(&RMFD, OSB08, EXEC("mode_RMFD_Light_HSIADI=0;"));
MapKey(&RMFD, BRTU, REXEC(61, 300, "if(mode_RMFD_Light_HSIADI) ActKey(PULSE+KEYON+Lighting_HSI_and_ADI_brightness_knob__Up);"));
MapKey(&RMFD, BRTD, REXEC(60, 300, "if(mode_RMFD_Light_HSIADI) ActKey(PULSE+KEYON+Lighting_HSI_and_ADI_brightness_knob_Down);"));
// Light Pit Panel + NVG on RMFD with OSB07
MapKey(&RMFD, OSB07, EXEC("mode_RMFD_Light_PitNVG=1;"));
MapKeyR(&RMFD, OSB07, EXEC("mode_RMFD_Light_PitNVG=0;"));
MapKey(&RMFD, BRTU, REXEC(59, 300, "if(mode_RMFD_Light_PitNVG) ActKey(PULSE+KEYON+Lighting_night_vision_cockpit_brightness_knob_Up);"));
MapKey(&RMFD, BRTD, REXEC(58, 300, "if(mode_RMFD_Light_PitNVG) ActKey(PULSE+KEYON+Lighting_night_vision_cockpit_brightness_knob_Down);"));
// OSB06
// OSB05
// OSB04
// OSB03
// R800 autres avec OSB02 sur RMFD
MapKey(&RMFD, OSB01, EXEC("mode_RMFD_R800=1;"));
MapKeyR(&RMFD, OSB01, EXEC("mode_RMFD_R800=0;"));
MapKey(&RMFD, GAINU, REXEC(57, 300, "if(mode_RMFD_R800) ActKey(PULSE+KEYON+Emergency_receiver);"));
MapKey(&RMFD, GAIND, REXEC(56, 300, "if(mode_RMFD_R800) ActKey(PULSE+KEYON+R_800_Squelch);"));
MapKey(&RMFD, SYMU, REXEC(55, 300, "if(mode_RMFD_R800) ActKey(PULSE+KEYON+Data_transfer_rate_switch);"));
MapKey(&RMFD, SYMD, REXEC(54, 300, "if(mode_RMFD_R800) ActKey(PULSE+KEYON+Test_button);"));
MapKey(&RMFD, CONU, REXEC(53, 300, "if(mode_RMFD_R800) ActKey(PULSE+KEYON+ADF_switchdefine);"));
MapKey(&RMFD, COND, REXEC(52, 300, "if(mode_RMFD_R800) ActKey(PULSE+KEYON+R_800_AM_FM_Mode_switch);"));
// R800 chanels avec OSB01 sur RMFD
MapKey(&RMFD, OSB01, EXEC("mode_RMFD_R800_Chanels=1;"));
MapKeyR(&RMFD, OSB01, EXEC("mode_RMFD_R800_Chanels=0;"));
MapKey(&RMFD, GAINU, REXEC(51, 300, "if(mode_RMFD_R800_Chanels) ActKey(PULSE+KEYON+R_800_Rotary_1_Up);"));
MapKey(&RMFD, GAIND, REXEC(50, 300, "if(mode_RMFD_R800_Chanels) ActKey(PULSE+KEYON+R_800_Rotary_1_Down);"));
MapKey(&RMFD, BRTU, REXEC(49, 300, "if(mode_RMFD_R800_Chanels) ActKey(PULSE+KEYON+R_800_Rotary_2_Up);"));
MapKey(&RMFD, BRTD, REXEC(48, 300, "if(mode_RMFD_R800_Chanels) ActKey(PULSE+KEYON+R_800_Rotary_2_Down);"));
MapKey(&RMFD, SYMU, REXEC(47, 300, "if(mode_RMFD_R800_Chanels) ActKey(PULSE+KEYON+R_800_Rotary_3_Up);"));
MapKey(&RMFD, SYMD, REXEC(46, 300, "if(mode_RMFD_R800_Chanels) ActKey(PULSE+KEYON+R_800_Rotary_3_Down);"));
MapKey(&RMFD, CONU, REXEC(45, 300, "if(mode_RMFD_R800_Chanels) ActKey(PULSE+KEYON+R_800_Rotary_4_Up);"));
MapKey(&RMFD, COND, REXEC(44, 300, "if(mode_RMFD_R800_Chanels) ActKey(PULSE+KEYON+R_800_Rotary_4_Down);"));
//
// ****** LEFT MFD section ********
//
// HSI sur LMFD avec OSB20 : OSB [ 20 + GAIN + SYM + 06 ]
MapKey(&LMFD, OSB20, EXEC("mode_LMFD_HSI=1;"));
MapKeyR(&LMFD, OSB20, EXEC("mode_LMFD_HSI=0;"));
MapKey(&LMFD, GAINU, REXEC(39, 300, "if(mode_LMFD_HSI) ActKey(PULSE+KEYON+HSI_Commanded_heading_rotary_right);"));
MapKey(&LMFD, GAIND, REXEC(38, 300, "if(mode_LMFD_HSI) ActKey(PULSE+KEYON+HSI_Commanded_heading_rotary_left);"));
MapKey(&LMFD, SYMU, REXEC(37, 300, "if(mode_LMFD_HSI) ActKey(PULSE+KEYON+HSI_Commanded_course_rotary_right);"));
MapKey(&LMFD, SYMD, REXEC(36, 300, "if(mode_LMFD_HSI) ActKey(PULSE+KEYON+HSI_Commanded_course_rotary_left);"));
MapKey(&LMFD, OSB06, EXEC("if(mode_LMFD_HSI) ActKey(PULSE+KEYON+HSI_Desired_track_angle_Desired_heading__Auto_Manual);"));
// Radar Altimeter sur LMFD avec OSB19 : OSB [ 19 + SYM ]
MapKey(&LMFD, OSB19, EXEC("mode_LMFD_RadAlt=1;"));
MapKeyR(&LMFD, OSB19, EXEC("mode_LMFD_RadAlt=0;"));
MapKey(&LMFD, SYMU, REXEC(35, 300, "if(mode_LMFD_RadAlt) ActKey(PULSE+KEYON+Radar_altimeter_dangerous_RALT_set_rotary_right);"));
MapKey(&LMFD, SYMD, REXEC(34, 300, "if(mode_LMFD_RadAlt) ActKey(PULSE+KEYON+Radar_altimeter_dangerous_RALT_set_rotary_left);"));
// ADI pitch sur LMFD avec OSB18 : OSB [ 18 + SYM ]
MapKey(&LMFD, OSB18, EXEC("mode_LMFD_ADI=1;"));
MapKeyR(&LMFD, OSB18, EXEC("mode_LMFD_ADI=0;"));
MapKey(&LMFD, SYMU, REXEC(33, 300, "if(mode_LMFD_ADI) ActKey(PULSE+KEYON+ADI_Zero_pitch_trim_right);"));
MapKey(&LMFD, SYMD, REXEC(32, 300, "if(mode_LMFD_ADI) ActKey(PULSE+KEYON+ADI_Zero_pitch_trim_left);"));
// Altimeter QFE sur LMFD avec OSB17 : OSB [ 17 + SYM ]
MapKey(&LMFD, OSB17, EXEC("mode_LMFD_QFE=1;"));
MapKeyR(&LMFD, OSB17, EXEC("mode_LMFD_QFE=0;"));
MapKey(&LMFD, SYMU, REXEC(31, 300, "if(mode_LMFD_QFE) ActKey(PULSE+KEYON+Altimeter_QFE_knob_pressure_increase);"));
MapKey(&LMFD, SYMD, REXEC(30, 300, "if(mode_LMFD_QFE) ActKey(PULSE+KEYON+Altimeter_QFE_knob_pressure_Decrease);"));
// OSB16
// ABRIS section on LMFD : OSB [ 10 + CON + 11-15 ]
// non modal, actif en permanence, choix personnel
MapKey(&LMFD, OSB11, ABRIS_Button_5);
MapKey(&LMFD, OSB12, ABRIS_Button_4);
MapKey(&LMFD, OSB13, ABRIS_Button_3);
MapKey(&LMFD, OSB14, ABRIS_Button_2);
MapKey(&LMFD, OSB15, ABRIS_Button_1);
MapKey(&LMFD, OSB10, ABRIS_Axis_Push);
MapKey(&LMFD, CONU, ABRIS_Axis_Increase);
MapKey(&LMFD, COND, ABRIS_Axis_Decrease);
// OSB09
// OSB08
// OSB07
// Mechanical Clock sur LFMD avec OSB01 : OSB [ 01 + 02-03 + 05 + GAIN + SYM ]
// dans le fichier FC2_KA_50_Macros.ttm il faut actiover les macros correspondant à l'horloge :
// ôter les // en début de ligne devant les lignes suivantes et ôter le . après Mech_clock:
//define Mech_clock_Left_lever_Up R_SHIFT+USB[0x10] //Mech clock. Left lever Up
//define Mech_clock._Left_lever_Down R_ALT+R_SHIFT+R_CTL+USB[0x06] //Mech clock. Left lever Down
//define Mech_clock._Left_lever_turning_right L_ALT+USB[0x37] //Mech clock. Left lever turning right
//define Mech_clock._Left_lever_turning_left L_ALT+USB[0x36] //Mech clock. Left lever turning left
//define Mech_clock._Right_lever_Down R_ALT+R_SHIFT+USB[0x06] //Mech clock. Right lever Down
//define Mech_clock._Right_lever_Rotate_right R_SHIFT+R_CTL+USB[0x37] //Mech clock. Right lever Rotate right
//define Mech_clock._Right_lever_Rotate_left R_SHIFT+R_CTL+USB[0x36] //Mech clock. Right lever Rotate left
MapKey(&LMFD, OSB01, EXEC("mode_LMFD_Clock=1;"));
MapKeyR(&LMFD, OSB01, EXEC("mode_LMFD_Clock=0;"));
MapKey(&LMFD, OSB02, EXEC("if(mode_LMFD_Clock) ActKey(PULSE+KEYON+Mech_clock_Left_lever_Up);"));
MapKey(&LMFD, OSB03, EXEC("if(mode_LMFD_Clock) ActKey(PULSE+KEYON+Mech_clock_Left_lever_Down);"));
MapKey(&LMFD, OSB05, EXEC("if(mode_LMFD_Clock) ActKey(PULSE+KEYON+Mech_clock_Right_lever_Down);"));
MapKey(&LMFD, GAINU, REXEC(43, 300, "if(mode_LMFD_Clock) ActKey(PULSE+KEYON+Mech_clock_Left_lever_turning_right);"));
MapKey(&LMFD, GAIND, REXEC(42, 300, "if(mode_LMFD_Clock) ActKey(PULSE+KEYON+Mech_clock_Left_lever_turning_left);"));
MapKey(&LMFD, SYMU, REXEC(41, 300, "if(mode_LMFD_Clock) ActKey(PULSE+KEYON+Mech_clock_Right_lever_Rotate_right);"));
MapKey(&LMFD, SYMD, REXEC(40, 300, "if(mode_LMFD_Clock) ActKey(PULSE+KEYON+Mech_clock_Right_lever_Rotate_left);"));
// OSB04
//
// ==========================***** fin section MFDS *****==============================
//
}
int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);
}
Moi je croyais que Hellfrog c'était un extra terrestre qui postait des codes ici pour ses copains de l'espace...Mad Fly a écrit :je croyais qu'il n'y avait que Hellfrog qui pouvait poster dans ce thread