forked from Aussiedroid/AD-EDWarthogEnhancedScript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AD_ED_v4.3.0.tmc
648 lines (564 loc) · 56.1 KB
/
AD_ED_v4.3.0.tmc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
// =============================================================================================================================================================//
// Version 4.3.0 \\ Released Sept 2016 | Updated Jun 2020 // Public Release #25 //
// =============================================================================================================================================================//
// AUSSIEDROID'S ACKNOWLEDGEMENTS // //
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
// Standing on the Shoulders of Giants! Creation of this TARGET Script would not have been possible without amazing ED Scripts I found online created by: //
// Alexandr Zhevedenko, Michael Lehman (WraithMG11235), CMDR Clicker, DarKcyde & Thomas Duployez (CMDR Touille). Script continues to evolve with all the great //
// feedback, ideas, bug reports & sharing of code... the help & support shown on the forums/guide has been been amazing! !! You ALL Rock! Thank you !! //
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
// GENERAL INFO & LINKS // //
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
// Created by Aussiedroid: (http://steamcommunity.com/id/aussiedroid | https://forums.frontier.co.uk/member.php/21601-Aussiedroid) //
// Full Guide: (http://steamcommunity.com/sharedfiles/filedetails/?id=769637037) //
// GitHub Resource: (https://github.com/Aussiedroid/AD-EDWarthogEnhancedScript) //
// Frontier Forums Discussion Thread: (https://forums.frontier.co.uk/showthread.php/293027-Aussiedroid-s-Enhanced-Thrustmaster-Warthog-Script) //
// Some Previous Ver. Reference Maps: (https://aussiedroid.imgur.com/) //
// //
// What's New? Release Notes? -> Scroll to End-of-File OR read Changelog/History <- //
// //
// Need help understanding this script? -> Click the (?) HELP button in top right corner of Target Script Editor OR ask a question in the Forum/Guide <- //
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
// MINIMUM REQUIREMENTS: THRUSTMASTER TARGET SOFTWARE v3.0.18.328+ \ DRIVERS+FIRMWARE 2018+ ->(https://support.thrustmaster.com/en/product/hotaswarthog-en/)<- //
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
// ** RECOMMENDED RUNNING SCRIPT IN TARGET GUI & EDITING VIA TARGET SCRIPT EDITOR ** //
// ** REMINDER: CUSTOMISE/SET YOUR USER PREFERENCES IN AD_EDUSERPREFS FILE ** //
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
// INCLUDED FILES //
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
include "Target.tmh" // Default System Import (Thrustmaster TARGET Functions)
include "AD_EDDefaults_v4.3.0.tmh" // Global Variable Settings, States & Timings/Delays
include "AD_EDUserPrefs_v4.3.0.tmh" // User Preferences & Script Customisation Options
include "AD_EDKeyMap_v4.3.0.ttm" // Variable Key Mapping & Reference Tables
include "AD_EDHardware_v4.3.0.tmh" // Joystick, Throttle & Rudder Axes/Curves Configuration
include "AD_EDMacros_v4.3.0.tmh" // Macro Definitions (Custom Sequences)
include "AD_EDFunctions_v4.3.0.tmh" // Function Definitions (Custom Logic for Buttons, Toggles & Ship Controls)
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
// START-UP: DEVICE CHECK / MAIN //
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
int main() { // Exclude Hardware from Virtual Device & Manage Additional Devices
Configure(&HCougar, MODE_EXCLUDED);
Configure(&T16000, MODE_EXCLUDED);
if(UseMFD == 0) { // No MFDs (Ignore configuring MFDs unless set in User Preferences)
Configure(&LMFD, MODE_EXCLUDED);
Configure(&RMFD, MODE_EXCLUDED); }
if(UseRuddersT16000 == 0) Configure(&TFRPRudder, MODE_EXCLUDED); // Enables Standard T.Flight T16000 Rudders
if(UseRuddersT16000 == 1) Configure(&TFRPRudder, MODE_FILTERED); // Enables Differential Toe Brakes on T.Flight T16000 Rudders (for mapping through Target Script)
if(UseRuddersTPR == 0) Configure(&TFRPHARudder, MODE_EXCLUDED); // Enables Standard T.Flight TPR Pedals
if(UseRuddersTPR == 1) Configure(&TFRPHARudder, MODE_FILTERED); // Enables Differential Toe Brakes on T.Flight TPR Pedals (for mapping through Target Script)Configure(&TFRPHARudder, MODE_FILTERED);
if(Init(&EventHandle)) return 1;
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
// START-UP: SOFTWARE // // *system("spawn -w \"software main folder" \"exe shortcut""); (*May not work on Win 10* - Use EDBAT instead)
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
if(StartSoftware == 1) { // Auto-Load on Script Run (Customise Example Paths below OR Add Your Own)
if(VerboseOutput) printf("Booting external software suite for Elite Dangerous...Done\x0a"); // (Note: All path '\' need to be '\\' for it to work)
// system("spawn -w \"C:\\Program Files (x86)\\NaturalPoint\\TrackIR5\" \"C:\\Program Files (x86)\\NaturalPoint\\TrackIR5\\TrackIR5.exe\""); // TRACKIR (URL= http://www.naturalpoint.com/trackir/)
// system("spawn -w \"C:\\Program Files (x86)\\VoiceAttack\" \"C:\\Program Files (x86)\\VoiceAttack\\VoiceAttack.exe\""); // VOICE ATTACK (URL= https://voiceattack.com/)
// system("spawn -w \"C:\\Program Files (x86)\\VoiceAttack\\Apps\\EDDI\" \"C:\\Program Files (x86)\\VoiceAttack\\Apps\\EDDI\\EDDI.exe""); // EDDI (URL= https://github.com/EDCD/EDDI/wiki)
// system("spawn -w \"C:\\Program Files (x86)\\EDMarketConnector\" \"C:\\Program Files (x86)\\EDMarketConnector\\EDMarketConnector.exe\""); // EDMC (URL= https://github.com/Marginal/EDMarketConnector/wiki)
// system("spawn -w \"C:\\Program Files (x86)\\EDDiscovery\" \"C:\\Program Files (x86)\\EDDiscovery\\EDDiscovery.exe\""); // EDDISCOVERY (URL= https://github.com/EDDiscovery/EDDiscovery/wiki)
// system("spawn -w \"C:\\Program Files\\EDFX\" \"C:\\Program Files\\EDFX\\EDFX64.exe\""); // EDFX (URL= http://edcodex.info/?m=tools&entry=58)
// system("spawn -w \"C:\\Users\\<USERNAME>\\AppData\\Local\\Discord\" \"C:\\Users\\<USERNAME>\\AppData\\Local\\Discord\\app-0.0.297\\Discord.exe\""); // DISCORD (URL= https://discordapp.com/)
// system("spawn -w \"C:\\Program Files (x86)\\Steam\\steamapps\\common\\Elite Dangerous\" \"C:\\Program Files (x86)\\Steam\\steamapps\\common\\Elite Dangerous\\EDLaunch.exe\""); // ELITE DANGEROUS LAUNCHER
}
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
// CORE SETTINGS: INITIALISATION //
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
AxisCurveMod = LIST(0,0, 33,25, 66,50, 80,75, 100,100); // Creates a custom axis curve for Throttle & Radar. [Faster->Slower Curve] (See AD_EDHardware.tmh) *LIST(Axis physical position, Axis output Value)
SetKBRate(PulseTime, DelayTime); // Base Settings (See AD_EDDefaults.tmh)
SetKBLayout(KBLayout);
// FUNCTION START //
initCustomMacroCommands(); // Initiate Custom Macros & Functions (See AD_EDMacros.tmh)
initEscapeVector(); // Initiate Advanced Macro to perform a tactical withdraw from combat (Retract Hardpoints, Set Defensive PIPs, Auto Boost/Chaff, Engage Supercruise) (See AD_EDMacros.tmh)
initSetThrottleCurves(); // Initiate Mapping of Custom Throttle Curves (3 Presets configurable in AD_EDUserPrefs.tmh)
initPrintState(); // Initiate Display Script Settings to Output Window in Script/GUI (See AD_EDFunctions.tmh)
initPIPMapper(); // Initiate PIP Configuration Mapper (See AD_EDFunctions.tmh)
initSetCombinedFire(0); // Initiate Mapping Logic to enable/disable the Dual-Stage Primary Trigger with either Primary & Secondary Fire Combined OR Primary Fire Only (Nothing mapped to 2nd stage). (See AD_EDFunctions.tmh)
initToggleRotationCorrection(); // Initiate Toggle Mapping for Rotational Correction (LED Support) (See AD_EDFunctions.tmh)
initToggleSilentRunning(); // Initiate Toggle Mapping for Silent Running (LED Support) (See AD_EDFunctions.tmh)
initEnhancedFAOFF(); // Initiate Toggle Mapping for Flight Assist Off (LED Support, Auto-Joystick Curve adjust) (See AD_EDFunctions.tmh)
initToggleLandingGear(); // Initiate Toggle Mapping for Landing Gear (LED Support) (See AD_EDFunctions.tmh)
initToggleCargoScoop(); // Initiate Toggle Mapping for Cargo Scoop (LED Support) (See AD_EDFunctions.tmh)
initIDLEMaster(); // Initiate Advanced Function to disable Throttle (& Boost) when engaging Throttle IDLE/Afterburner Lock Indent. Will also enable SRV Handbrake. (See AD_EDFunctions.tmh)
initHeadlookModeSelect(); // Initiate Custom mapping preference for Headlook Centering based on your hardware (TrackIR, VR, Mouse) (See AD_EDFunctions.tmh)
initHardpointManagement(); // Initiate Advanced Function integrating all Hardpoint/Other functions related to the Red Left Throttle Button (See AD_EDFunctions.tmh)
initMicCommander(); // Initiate Full control over Internal & External Mic Push-to-Talk functionality for Hold & Toggle configurations (See AD_EDFunctions.tmh)
initUserHotSlotPinkyTrigger(); // Initiate Double Tap Functionality on the Joystick Pinky Trigger (See AD_EDFunctions.tmh)
initLEDController(0); // Initiate Short LED Flashing Sequence on Toggle Flip & a Pattern on Startup. (LED Support) (See AD_EDFunctions.tmh)
initAPEngageEnhancer(); // Initiate Autopilot Engage button customisation (See AD_EDFunctions.tmh) (includes Auto-Dock & Signal Light Macros)
initExplorerScannerDisengage(); // Initiate Repeater Fire Explorer-Scanner Disengage/Off Console Printout
// HARDWARE CONFIG //
initJoystickAxis(); // Initiate HOTAS Axis Mappings
initThrottleAxis();
if(UseMFD > 0) initRightMFD(); // Initiate the First MFD Only (Initialise via MAP MFD CONTROLS section below) *UNTESTED*
if(UseMFD > 1) initLeftMFD(); // Initiate the First+Second MFD (Initialise via MAP MFD CONTROLS section below) *UNTESTED*
if(UseRuddersT16000 == 1) initTFRPRudder(); // Enables T.Flight TFRP T16000 Rudder Intialisation. (Note: T.Flight Rudder Axes are Configured below in EVENT HANDLER)
if(UseRuddersTPR == 1) initTFRPHARudder(); // Enables T.Flight TPR Pedal Intialisation. (Note: T.Flight Rudder Axes are Configured below in EVENT HANDLER)
// Syntax: KeyAxis(&Device, axis name, layer(s), AXMAP1(number of zones, up event, down event, optional center event);
if(CruiseOnThrottle == 1) KeyAxis(&Throttle, THR_RIGHT, 0, AXMAP1(LIST(0,1,99,100), // Supercruise on Throttle 100% / 0% [Note: Throttle Axis 'Full Range' Curves adjusted -10% when active] (This sets 3 zones on the axis, 0-1%, 1-99%, 99-100% for mapping)
EXEC("if(Joystick[S4]) ActKey(KEYON+PULSE+FrameShiftDrive);" // 99-100% IF Pinky Modifier Held, Activate Hyperspace Jump (Up Event)
"if(Joystick[H4P]) ActKey(KEYON+PULSE+Supercruise);"), // 99-100% IF CMS Modifier Held, Activate Supercruise (Up Event)
EXEC("if(Joystick[S4]) ActKey(KEYON+PULSE+FrameShiftDrive);" // 0-1% IF Pinky Modifier Held, Activate Hyperspace Jump (Down Event)
"if(Joystick[H4P]) ActKey(KEYON+PULSE+Supercruise);"), // 0-1% IF CMS Modifier Held, Activate Supercruise (Down Event)
0)); // 1-99% ELSE do nothing (Center Event)
// AXIS PRESET TOGGLES // // Map Flaps Select Toggle to Throttle Axis Presets & Set Overrides
if(ThrottleOverride == 0) { // Default Throttle Axis Preset Toggle Configuration
MapKey(&Throttle, FLAPU, EXEC("if(!Throttle[IDLELON]) ActKey(KEYON+PULSE+ThrottlePresetUP);")); // Flaps UP (Safety: Only Activate When Throttle IDLE is not Locked ON)
MapKey(&Throttle, FLAPM, EXEC("if(!Throttle[IDLELON]) ActKey(KEYON+PULSE+ThrottlePresetMID);")); // Flaps MIDDLE (Safety: Only Activate When Throttle IDLE is not Locked ON)
MapKey(&Throttle, FLAPD, EXEC("if(!Throttle[IDLELON]) ActKey(KEYON+PULSE+ThrottlePresetDOWN);")); }// Flaps DOWN (Safety: Only Activate When Throttle IDLE is not Locked ON)
if(ThrottleOverride == 1) { // User Configured Throttle Axis Preset Toggle Configuration (set in the User Prefs)
MapKey(&Throttle, FLAPU, EXEC("ActKey(KEYON+PULSE+ThrottlePresetUPALT);")); // Flaps UP (Safety: Only Activate When Throttle IDLE is not Locked ON)
MapKey(&Throttle, FLAPM, 0); // Flaps MIDDLE (Default: Not mapped to avoid conflicts)
MapKey(&Throttle, FLAPD, EXEC("ActKey(KEYON+PULSE+ThrottlePresetDWNALT);")); } // Flaps DOWN (Safety: Only Activate When Throttle IDLE is not Locked ON)
// Map Throttle Autopilot to Joystick Curve Presets
if(JoystickOverride == 0) { // Default Joystick Axis Preset Toggle Configuration
MapKey(&Throttle, APPAT, EXEC("initSetJoystickCurves();")); // Autopilot PATH UP
MapKey(&Throttle, APAH, EXEC("initSetJoystickCurves();")); // Autopilot ALT/HDG MIDDLE (Default)
MapKey(&Throttle, APALT, EXEC("initSetJoystickCurves();")); } // Autopilot ALT DOWN
if(JoystickOverride == 1) { // User Configured Joystick Axis Preset Toggle Configuration (set in the User Prefs)
if(StartupLock) { // On Startup Only, set the default Joystick Behaviour (set in the User Prefs)
SetSCurve(&Joystick, JOYX, 0, JS_DEADZONE, 0, JS_CURVE[JoystickPresetDEF], JS_ZOOM[JoystickPresetDEF]); // Set Joystick X Axis
SetSCurve(&Joystick, JOYY, 0, JS_DEADZONE, 0, JS_CURVE[JoystickPresetDEF], JS_ZOOM[JoystickPresetDEF]); }// Set Joystick Y Axis
MapKey(&Throttle, APPAT, EXEC("ActKey(KEYON+PULSE+JoystickPresetUPALT);")); // Autopilot PATH UP
MapKey(&Throttle, APAH, 0); // Autopilot ALT/HDG MIDDLE (Default: Not mapped to avoid conflicts)
MapKey(&Throttle, APALT, EXEC("ActKey(KEYON+PULSE+JoystickPresetDWNALT);")); } // Autopilot ALT DOWN
StartupLock = 0; // Startup Pre-checks: "Releases" the Startup Lock post initialising the Macros/Functions/Hardware above.
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
// MAP JOYSTICK CONTROLS //
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
// PRIMARY FIRE //
SetShiftButton(&Joystick, S4, &Throttle, PSF, PSB); // Set Shift Button (Pinky Toggle Switch) for MapKeyIOUMD (With UDTOGGLE = Toggle, Without = Hold -> See Page 22 of manual)
MapKeyIOUMD(&Joystick, TG1, // Trigger 1 [Primary Trigger]
SEQ( EXEC( "ActKey(KEYON+DOWN+PrimaryFire); EndlessStatePri = 1; if(VerboseOutput) printf(\"Repeater Fire: COMBAT-ENDLESS [ON] (PRIMARY)\\x0a\");"), // IU
EXEC( "ActKey(KEYON+UP+PrimaryFire); EndlessStatePri = 0; if(VerboseOutput) printf(\"Repeater Fire: COMBAT-ENDLESS [OFF] (PRIMARY)\\x0a\");")),
EXEC( "ActKey(KEYON+DOWN+PrimaryFire);"), // OU
EXEC("if(!Joystick[H4P]) ActKey(KEYON+DOWN+PrimaryFire); if(VerboseOutput) printf(\"Repeater Fire: EXPLORER-SCANNER [ON] (PRIMARY)\\x0a\");" // IM
"if(!Joystick[H4P]) DeferCall(ScanTimer, &ActKey, KEYON+UP+PrimaryFire); DeferCall(ScanTimer, &ActKey, initExplorerScannerDisengage());"
"if(Joystick[H4P]) initSetCombinedFire(1);"),
EXEC( "ActKey(KEYON+DOWN+PrimaryFire);"), // OM
SEQ(REXEC(0, MineTimer, "ActKey(KEYON+PULSE+PrimaryFire); if(VerboseOutput) printf(\"Repeater Fire: MINING-AUTO-PULSE [^FIRED^] (PRIMARY)\\x0a\");", RNOSTOP), // ID
EXEC( "StopAutoRepeat(0); if(VerboseOutput) printf(\"Repeater Fire: MINING-AUTO-PULSE [DISABLE] (PRIMARY)\\x0a\");")),
EXEC( "ActKey(KEYON+DOWN+PrimaryFire);")); // OD
MapKeyRIOUMD(&Joystick, TG1, // Release Trigger 1 [Primary Trigger]
0, EXEC("if(!EndlessStatePri) ActKey(KEYON+UP+PrimaryFire);"), // IU, OU // Only Releases if Combat-Endless Mode is NOT enabled (keeps sequence in sync)
0, EXEC("if(!EndlessStatePri) ActKey(KEYON+UP+PrimaryFire);"), // IM, OM
0, EXEC("if(!EndlessStatePri) ActKey(KEYON+UP+PrimaryFire);")); // ID, OD
// MapKey(&Joystick, TG2, SecondaryFire); // Trigger 2 [Second Stage Trigger] (Mapped in initHardpointManagement())
// MapKeyR(&Joystick, TG2, EXEC("ActKey(KEYON+UP+SecondaryFire);")); // Release Trigger 2 [Second Stage Trigger] (Keeps Primary firing after releasing Secondary Tier)
MapKeyR(&Joystick, TG2, EXEC("if(combinePriSecFire) ActKey(KEYON+UP+SecondaryFire);" // Release Trigger 2 [Second Stage Trigger]
"if(combinePriSecFire) ActKey(KEYON+DOWN+PrimaryFire);")); // (Keeps Primary Fire firing after releasing Secondary Tier Trigger)
// UTILITY SLOTS //
if(ShipUtilityPref == 0) {
MapKey(&Joystick, S1, TEMPO(PULSE+FireChaffLauncher, PULSE+DeployHeatSink, LongPressDelay)); // Master Mode Control [Short: Chaff, Long: Heat Sink]
MapKey(&Joystick, S2, TEMPO(SRVTurret, PULSE+UseShieldCell, LongPressDelay)); } // Weapon Release [Short: ECM/SRV Turret, Long: Shield Cell]
if(ShipUtilityPref == 1) {
MapKey(&Joystick, S1, TEMPO(PULSE+DeployHeatSink, PULSE+FireChaffLauncher, LongPressDelay)); // Master Mode Control [Short: Heat Sink, Long: Chaff]
MapKey(&Joystick, S2, TEMPO(PULSE+UseShieldCell, SRVTurret, LongPressDelay)); } // Weapon Release [Short: Shield Cell, Long: ECM/SRV Turret]
// SECONDARY FIRE //
if(SecFirePinkyPref == 0) {
MapKeyIOUMD(&Joystick, S3, // Pinky Button [Secondary Fire]
SEQ( EXEC( "ActKey(KEYON+DOWN+SecondaryFire); EndlessStateSec = 1; if(VerboseOutput) printf(\"Repeater Fire: COMBAT-ENDLESS [ON] (SECONDARY)\\x0a\");"), // IU
EXEC( "ActKey(KEYON+UP+SecondaryFire); EndlessStateSec = 0; if(VerboseOutput) printf(\"Repeater Fire: COMBAT-ENDLESS [OFF] (SECONDARY)\\x0a\");")),
EXEC( "ActKey(KEYON+DOWN+SecondaryFire);"), // OU
EXEC( "ActKey(KEYON+DOWN+SecondaryFire); if(VerboseOutput) printf(\"Repeater Fire: EXPLORER-SCANNER [ON] (SECONDARY)\\x0a\");" // IM
"DeferCall(ScanTimer, &ActKey, KEYON+UP+SecondaryFire); DeferCall(ScanTimer, &ActKey, initExplorerScannerDisengage());"),
EXEC( "ActKey(KEYON+DOWN+SecondaryFire);"), // OM
SEQ(REXEC(0, MineTimer, "ActKey(KEYON+PULSE+SecondaryFire); if(VerboseOutput) printf(\"Repeater Fire: MINING-AUTO-PULSE [^FIRED^] (SECONDARY)\\x0a\");", RNOSTOP), // ID
EXEC( "StopAutoRepeat(0); if(VerboseOutput) printf(\"Repeater Fire: MINING-AUTO-PULSE [DISABLE] (SECONDARY)\\x0a\");")),
EXEC( "ActKey(KEYON+DOWN+SecondaryFire);")); // OD
MapKeyRIOUMD(&Joystick, S3, // Release Pinky Button [Secondary Fire]
0, EXEC("if(!EndlessStateSec) ActKey(KEYON+UP+SecondaryFire);"), // IU, OU // Only Releases if Combat-Endless Mode is NOT enabled (keeps sequence in sync)
0, EXEC("if(!EndlessStateSec) ActKey(KEYON+UP+SecondaryFire);"), // IM, OM
0, EXEC("if(!EndlessStateSec) ActKey(KEYON+UP+SecondaryFire);")); } // ID, OD
if(SecFirePinkyPref == 1) {
MapKey(&Joystick, S3, TEMPO(PULSE+PinkyBtnDefaultShort, PULSE+PinkyBtnDefaultLong, LongPressDelay)); } // Pinky Button [USER DEFINED] [Short/Long: Set in User Preference]
// DOUBLE-TAP PINKY TRIGGER //
MapKey(&Joystick, S4, EXEC("initUserHotSlotPinkyTrigger();")); // Trigger 3 [Pinky Trigger] [Modifier Key] [DO NOT REMAP!]
MapKeyR(&Joystick, S4, UP+PinkyTriggerDefault); // Release Pinky Trigger [Modifier Key] (Disable with // if using the line below)
// MapKeyR(&Joystick, S4, UP+UserDTPinkyKeyBind); // Release ALT (enable by removing the //, if Double Tap Pinky Trigger mapping needs a 'Hold' action)
// COMMS CONTROL PANEL HAT SWITCH (NON-VOICE) //
MapKeyIOUMD(&Joystick, H1U, // Trim Switch UP
EXEC("initSendChatString(chat_Modifier_UP);"), // IU
EXEC("initSendChatString(chat_Basic_UP);"), // OU
EXEC("ActKey(KEYON+PULSE+mReportCrimesToggle);"), // IM
EXEC("ActKey(KEYON+PULSE+WingmanTarget);"), // OM
EXEC("ActKey(KEYON+PULSE+FighterFocusAttack);"), // ID
EXEC("ActKey(KEYON+PULSE+FighterAggressive);")); // OD
MapKeyIOUMD(&Joystick, H1D, // Trim Switch DOWN
EXEC("initSendChatString(chat_Modifier_DOWN);"), // IU
EXEC("initSendChatString(chat_Basic_DOWN);"), // OU
EXEC("ActKey(KEYON+PULSE+WingmanNavlock);"), // IM
EXEC("ActKey(KEYON+PULSE+SelectWingman2);"), // OM
EXEC("ActKey(KEYON+PULSE+FighterDock);"), // ID
EXEC("ActKey(KEYON+PULSE+FighterOrders);")); // OD
MapKeyIOUMD(&Joystick, H1L, // Trim Switch LEFT
EXEC("initSendChatString(chat_Modifier_LEFT);"), // IU
EXEC("initSendChatString(chat_Basic_LEFT);"), // OU
EXEC("ActKey(KEYON+PULSE+mNAVBeaconOff);"), // IM
EXEC("ActKey(KEYON+PULSE+SelectWingman1);"), // OM
EXEC("ActKey(KEYON+PULSE+FighterHoldPosition);"), // ID
EXEC("ActKey(KEYON+PULSE+FighterDefensive);")); // OD
MapKeyIOUMD(&Joystick, H1R, // Trim Switch RIGHT
EXEC("initSendChatString(chat_Modifier_RIGHT);"), // IU
EXEC("initSendChatString(chat_Basic_RIGHT);"), // OU
EXEC("ActKey(KEYON+PULSE+mNAVBeaconWing);"), // IM
EXEC("ActKey(KEYON+PULSE+SelectWingman3);"), // OM
EXEC("ActKey(KEYON+PULSE+FighterHoldFire);"), // ID
EXEC("ActKey(KEYON+PULSE+FighterFollow);")); // OD
// MapKey(&Joystick, H2U, 0); // Target Management Switch (TMS) UP (Mapped in ED Bindings File)
// MapKey(&Joystick, H2D, 0); // Target Management Switch (TMS) DOWN (Mapped in ED Bindings File)
// MapKey(&Joystick, H2L, 0); // Target Management Switch (TMS) LEFT (Mapped in ED Bindings File)
// MapKey(&Joystick, H2R, 0); // Target Management Switch (TMS) RIGHT (Mapped in ED Bindings File)
// Data Management Switch (DMS): Advanced PIP Selection (4 Configurations)
// PIP CONFIG // // [NOTE: Set UserPIPPref in the AD_EDUserPrefs.tmh file]
if(UserPIPPref == 0) { // DOUBLE-TIER (INVERTED) [Inc. short & long press, no modifier]
MapKey(&Joystick, PUP, TEMPO(EXEC("if(!Joystick[S4]) initPIPMapper(ENG,SYS);" // DMS UP (H3U) [Short: 4xENG 2xSYS]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioPlayPause);"), // [Short+Pinky: GalNet Audio Play/Pause]
EXEC("if(!Joystick[S4]) ActKey(KEYON+PULSE+PowerEng);" // [Long: 1xENG]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioPlayPause);"), // [Long+Pinky: GalNet Audio Play/Pause]
PIPPressDelay));
MapKey(&Joystick, PDN, TEMPO(EXEC("if(!Joystick[S4]) initPIPMapper(SYS,WEP,MID);"), // DMS DOWN (H3D) [Short: 3xSYS 3xWEP]
EXEC("if(!Joystick[S4]) ActKey(KEYON+PULSE+BalancePower);" // [Long: Balance]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioClearQueue);"), // [Long+Pinky: GalNet Audio Clear Queue]
PIPPressDelay));
MapKey(&Joystick, PLT, TEMPO(EXEC("if(!Joystick[S4]) initPIPMapper(SYS,WEP);" // DMS LEFT (H3L) [Short: 4xSYS 2xWEP]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioPrev);"), // [Short+Pinky: GalNet Audio Previous Track]
EXEC("if(!Joystick[S4]) ActKey(KEYON+PULSE+PowerSys);" // [Long: 1xSYS]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioPrev);"), // [Long+Pinky: GalNet Audio Previous Track]
PIPPressDelay));
MapKey(&Joystick, PRT, TEMPO(EXEC("if(!Joystick[S4]) initPIPMapper(WEP,ENG);" // DMS RIGHT (H3R) [Short: 4xWEP 2xSYS]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioNext);"), // [Short+Pinky: GalNet Audio Next Track]
EXEC("if(!Joystick[S4]) ActKey(KEYON+PULSE+PowerWep);" // [Long: 1xWEP]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioNext);"), // [Long+Pinky: GalNet Audio Next Track]
PIPPressDelay)); }
if(UserPIPPref == 1) { // STANDARD SINGLE-TIER PIPS [*Elite Dangerous Default Functionality*]
MapKey(&Joystick, PUP, EXEC( "if(!Joystick[S4]) ActKey(KEYON+PULSE+PowerEng);" // DMS UP (H3U) [Power to Engines (1 PIP)]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioPlayPause);")); // [Short+Pinky: GalNet Audio Play/Pause]
MapKey(&Joystick, PDN, TEMPO(EXEC("if(!Joystick[S4]) ActKey(KEYON+PULSE+BalancePower);"), // DMS DOWN (H3D)[Balance Power (1 PIP)]
EXEC("if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioClearQueue);"), // [Long+Pinky: GalNet Audio Clear Queue]
PIPPressDelay));
MapKey(&Joystick, PLT, EXEC( "if(!Joystick[S4]) ActKey(KEYON+PULSE+PowerSys);" // DMS LEFT (H3L) [Power to Systems (1 PIP)]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioPrev);")); // [Short+Pinky: GalNet Audio Previous Track]
MapKey(&Joystick, PRT, EXEC( "if(!Joystick[S4]) ActKey(KEYON+PULSE+PowerWep);" // DMS RIGHT (H3R) [Power to Weapons (1 PIP)]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioNext);")); } // [Short+Pinky: GalNet Audio Next Track]
if(UserPIPPref == 2) { // DOUBLE-TIER PIPS [Inc. short & long press, no modifier]
MapKey(&Joystick, PUP, TEMPO(EXEC("if(!Joystick[S4]) ActKey(KEYON+PULSE+PowerEng);" // DMS UP (H3U) [Short: 1xENG]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioPlayPause);"), // [Short+Pinky: GalNet Audio Play/Pause]
EXEC("if(!Joystick[S4]) initPIPMapper(ENG,SYS);" // [Long: 4xENG 2xSYS]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioPlayPause);"), // [Long+Pinky: GalNet Audio Play/Pause]
PIPPressDelay));
MapKey(&Joystick, PDN, TEMPO(EXEC("if(!Joystick[S4]) ActKey(KEYON+PULSE+BalancePower);"), // DMS DOWN (H3D) [Short: Balance]
EXEC("if(!Joystick[S4]) initPIPMapper(SYS,WEP,MID);" // [Long: 3xSYS 3xWEP]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioClearQueue);"), // [Long+Pinky: GalNet Audio Clear Queue]
PIPPressDelay));
MapKey(&Joystick, PLT, TEMPO(EXEC("if(!Joystick[S4]) ActKey(KEYON+PULSE+PowerSys);" // DMS LEFT (H3L) [Short: 1xSYS]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioPrev);"), // [Short+Pinky: GalNet Audio Previous Track]
EXEC("if(!Joystick[S4]) initPIPMapper(SYS,WEP);" // [Long: 4xSYS 2xWEP]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioPrev);"), // [Long+Pinky: GalNet Audio Previous Track]
PIPPressDelay));
MapKey(&Joystick, PRT, TEMPO(EXEC("if(!Joystick[S4]) ActKey(KEYON+PULSE+PowerWep);" // DMS RIGHT (H3R) [Short: 1xWEP]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioNext);"), // [Short+Pinky: GalNet Audio Next Track]
EXEC("if(!Joystick[S4]) initPIPMapper(WEP,ENG);" // [Long: 4xWEP 2xENG]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioNext);"), // [Long+Pinky: GalNet Audio Next Track]
PIPPressDelay)); }
if(UserPIPPref == 3) { // TRIPLE-TIER PIPS [Inc. short/medium/long presses, no modifier]
MapKey(&Joystick, PUP, TEMPO(EXEC("if(!Joystick[S4]) ActKey(KEYON+PULSE+PowerEng);" // DMS UP (H3U) [Short: 1xENG]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioPlayPause);"), // [Short+Pinky: GalNet Audio Play/Pause]
TEMPO(EXEC("if(!Joystick[S4]) initPIPMapper(ENG,SYS);" // [Med: 4xENG 2xSYS]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioPlayPause);"), // [Med+Pinky: GalNet Audio Play/Pause]
EXEC("if(!Joystick[S4]) initPIPMapper(ENG,WEP);" // [Long: 4xENG 2xWEP]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioPlayPause);"), // [Long+Pinky: GalNet Audio Play/Pause]
PIPPressDelay), PIPPressDelay));
MapKey(&Joystick, PDN, TEMPO(EXEC("if(!Joystick[S4]) ActKey(KEYON+PULSE+BalancePower);"), // DMS DOWN (H3D) [Short: Balance]
TEMPO(EXEC("if(!Joystick[S4]) initPIPMapper(SYS,WEP,MID);"), // [Med: 3xSYS 3xWEP]
EXEC("if(!Joystick[S4]) initPIPMapper(ENG,WEP,MID);" // [Long: 3xENG, 3xWEP]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioClearQueue);"), // [Long+Pinky: GalNet Audio Clear Queue]
PIPPressDelay), PIPPressDelay));
MapKey(&Joystick, PLT, TEMPO(EXEC("if(!Joystick[S4]) ActKey(KEYON+PULSE+PowerSys);" // DMS LEFT (H3L) [Short: 1xSYS]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioPrev);"), // [Short+Pinky: GalNet Audio Previous Track]
TEMPO(EXEC("if(!Joystick[S4]) initPIPMapper(SYS,ENG);" // [Med: 4xSYS 2xENG]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioPrev);"), // [Med+Pinky: GalNet Audio Previous Track]
EXEC("if(!Joystick[S4]) initPIPMapper(SYS,WEP);" // [Long: 4xSYS 2xWEP]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioPrev);"), // [Long+Pinky: GalNet Audio Previous Track]
PIPPressDelay), PIPPressDelay));
MapKey(&Joystick, PRT, TEMPO(EXEC("if(!Joystick[S4]) ActKey(KEYON+PULSE+PowerWep);" // DMS RIGHT (H3R) [Short: 1xWEP]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioNext);"), // [Short+Pinky: GalNet Audio Next Track]
TEMPO(EXEC("if(!Joystick[S4]) initPIPMapper(WEP,ENG);" // [Med: 4xWEP 2xENG]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioNext);"), // [Med+Pinky: GalNet Audio Next Track]
EXEC("if(!Joystick[S4]) initPIPMapper(WEP,SYS);" // [Long: 4xWEP 2xSYS]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GalNetAudioNext);"), // [Long+Pinky: GalNet Audio Next Track]
PIPPressDelay), PIPPressDelay)); }
// MapKey(&Joystick, H4U, 0); // Countermeasures Management Switch (CMS) UP (Mapped in ED Bindings File)
// MapKey(&Joystick, H4D, 0); // Countermeasures Management Switch (CMS) DOWN (Mapped in ED Bindings File)
// MapKey(&Joystick, H4L, 0); // Countermeasures Management Switch (CMS) LEFT (Mapped in ED Bindings File)
// MapKey(&Joystick, H4R, 0); // Countermeasures Management Switch (CMS) RIGHT (Mapped in ED Bindings File)
// MapKey(&Joystick, H4P, 0); // Countermeasures Management Switch (CMS) PUSH (Mapped in ED Bindings File)
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
// MAP THROTTLE ARM CONTROLS
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
// BOOST & HARDPOINT BUTTONS //
MapKey(&Throttle, SC, TEMPO(0, EXEC( // Slew Control Button
"if(!Joystick[S4] & !Throttle[FLAPD] & !Throttle[IDLELON]) ActKey(KEYON+DOWN+SRVVerticalThrust);" // [Hold]
"if(!Joystick[S4] & !Throttle[FLAPD] & !Throttle[IDLELON]) ActKey(KEYON+PULSE+EngineBoost);" // [Press]
"if(Joystick[S4] & !Throttle[FLAPD] & !Throttle[IDLELON]) ActKey(KEYON+PULSE+mBoostBrake);"), // [Modifier]
MiniPressDelay)); // Safety: Won't Boost when in Precise Throttle or IDLE! Plus 150ms Delay :)
MapKeyR(&Throttle, SC, EXEC( "ActKey(KEYON+UP+SRVVerticalThrust);")); // Release the SRV Vertical Thrust
MapKey(&Throttle, LTB, TEMPO(EXEC( "initHardpointManagement();"), // Left Throttle Button (RED)
EXEC(
"if(!Joystick[H4P] & !Joystick[S4]) ActKey(KEYON+DOWN+ShowCQCScoreboard);" // If in CQC: Show Scoreboard (Hold) | If NOT in CQC: Reset Hardpoint Flag (fix alignment issues with Escape Vector Macro)
"if(!Joystick[H4P] & !Joystick[S4]) HPoints=!HPoints;"), // Hardpoint Flag Override IF Escape Vector gets out of alignment.
LongPressDelay)); // [Have System selected prior to High Wake]
MapKeyR(&Throttle, LTB, EXEC( "ActKey(KEYON+UP+ShowCQCScoreboard);")); // Release CQC Scoreboard display
// MapKey(&Throttle, MSU, 0); // Mic Switch UP (Mapped in ED Bindings File)
// MapKey(&Throttle, MSD, 0); // Mic Switch DOWN (Mapped in ED Bindings File)
// MapKey(&Throttle, MSL, 0); // Mic Switch LEFT (Mapped in ED Bindings File)
// MapKey(&Throttle, MSR, 0); // Mic Switch RIGHT (Mapped in ED Bindings File)
MapKey(&Throttle, MSP, EXEC("initMicCommander();")); // Mic Switch PUSH
MapKeyR(&Throttle, MSP, EXEC("initMicCommander();")); // Mic Switch PUSH RELEASE
// MapKey(&Throttle, CSU, 0); // Coolie Hat Switch UP (Mapped in ED Bindings File)
// MapKey(&Throttle, CSD, 0); // Coolie Hat Switch DOWN (Mapped in ED Bindings File)
// MapKey(&Throttle, CSL, 0); // Coolie Hat Switch LEFT (Mapped in ED Bindings File)
// MapKey(&Throttle, CSR, 0); // Coolie Hat Switch RIGHT (Mapped in ED Bindings File)
// FLIGHT ASSIST MODE //
MapKey(&Throttle, SPDF, EXEC("initEnhancedFAOFF();")); // Speedbrake Forward TOGGLE ON
MapKeyR(&Throttle, SPDF, EXEC("initEnhancedFAOFF();")); // Speedbrake Forward TOGGLE RELEASE
MapKey(&Throttle, SPDB, EXEC("initEnhancedFAOFF();")); // Speedbrake Back HOLD
MapKeyR(&Throttle, SPDB, EXEC("initEnhancedFAOFF();")); // Speedbrake Back RELEASE
// NAVIGATION BOAT SWITCH //
MapKey(&Throttle, BSF, PULSE+GalaxyMap); // Boat Switch Throttle FORWARD
MapKey(&Throttle, BSM, PULSE+UIBack); // Boat Switch Throttle MIDDLE [Centering Switch will Exit Maps]
MapKey(&Throttle, BSB, PULSE+SystemMap); // Boat Switch Throttle BACK
// CRUISE ON THROTTLE CONFIG //
if(CruiseOnThrottle == 0) { // Sets China Hat to add Frame Shift Drive when Cruise on Throttle is disabled.
MapKey(&Throttle, CHF, TEMPO(FrameShiftDrive, Supercruise, LongPressDelay)); // China Hat FORWARD [When Route Blocked HOLD for Supercruise]
MapKey(&Throttle, CHB, TEMPO(EXEC( // China Hat BACK [Short: Night Vision or Orbital Lines(+Pinky), Very Long: Next Sys Route]
"if(Joystick[S4]) ActKey(KEYON+PULSE+OrbitalLines);"
"if(!Joystick[S4]) initNightVisionEnhancer(1);"),
EXEC(
"if(!Joystick[S4]) ActKey(KEYON+PULSE+SelectNextSystemInRoute);"), LongPressDelay)); }
if(CruiseOnThrottle == 1) { // Sets China Hat to remove Frame Shift Drive when Cruise on Throttle is enabled.
MapKey(&Throttle, CHF, EXEC( // China Hat FORWARD
"if(Joystick[S4]) ActKey(KEYON+PULSE+OrbitalLines);"
"else initNightVisionEnhancer(1);"));
MapKey(&Throttle, CHB, PULSE+SelectNextSystemInRoute); } // China Hat BACK
// SHIFT KEY ADDITIONAL MAPPINGS //
MapKey(&Throttle, PSF, EXEC( // Pinky Throttle Switch FORWARD
"if(Joystick[H4P]) ActKey(KEYON+PULSE+mJumpNextSubSys);"
"if(Joystick[S4]) initSendChatString(chat_ClearChatBox);"
"if(!Joystick[S4] & !Joystick[H4P] & VerboseOutput) { printf(\"SHIFT KEY FORWARD >>> [Comms Channel: AUTO-TEXT]\\x0a\"); printf(\"SHIFT KEY FORWARD >>> [Repeater Mode: COMBAT-ENDLESS]\\x0a\"); }"));
MapKey(&Throttle, PSM, EXEC( // Pinky Throttle Switch MIDDLE
"if(Joystick[H4P]) ActKey(KEYON+PULSE+mJumpMidSubSys);"
"if(!Joystick[S4] & !Joystick[H4P] & VerboseOutput) { printf(\"SHIFT KEY MIDDLE ---- [Comms Channel: WINGS]\\x0a\"); printf(\"SHIFT KEY MIDDLE ---- [Repeater Mode: EXPLORER-SCANNER]\\x0a\"); }"));
MapKey(&Throttle, PSB, EXEC( // Pinky Throttle Switch BACK
"if(Joystick[H4P]) ActKey(KEYON+PULSE+mJumpPrevSubSys);"
"if(Joystick[S4]) ActKey(KEYON+PULSE+HideShipGUI);"
"if(!Joystick[S4] & !Joystick[H4P] & VerboseOutput) { printf(\"SHIFT KEY BACKWARD <<< [Comms Channel: FIGHTER]\\x0a\"); printf(\"SHIFT KEY BACKWARD <<< [Repeater Mode: MINING-AUTO-PULSE]\\x0a\"); }"));
MapKeyR(&Throttle, PSB, EXEC( // Pinky Throttle Switch BACK RELEASE
"if(Joystick[S4]) ActKey(KEYON+PULSE+HideShipGUI);"));
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
// MAP THROTTLE BASE CONTROLS
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
// AUX. OSD & REPORT CRIMES GAME CONTROLS //
MapKey(&Throttle, EFLNORM, EXEC( // Engine Fuel Flow Norm/Override Switches LEFT
"if(!Joystick[S4] & !ShowGameStatState) ActKey(KEYON+PULSE+mShowGameStats);"
"if(!Joystick[S4] & !ShowGameStatState) ShowGameStatState = 1;"
"if(Joystick[S4] & !ReportCrimeState) ActKey(KEYON+PULSE+mReportCrimesToggle);"
"if(Joystick[S4] & !ReportCrimeState) ReportCrimeState = 1;"));
MapKeyR(&Throttle, EFLNORM, EXEC( // Engine Fuel Flow Norm/Override Switches LEFT RELEASE
"if(!Joystick[S4] & ShowGameStatState) ActKey(KEYON+PULSE+mShowGameStats);"
"if(!Joystick[S4] & ShowGameStatState) ShowGameStatState = 0;"
"if(Joystick[S4] & ReportCrimeState) ActKey(KEYON+PULSE+mReportCrimesToggle);"
"if(Joystick[S4] & ReportCrimeState) ReportCrimeState = 0;"));
MapKey(&Throttle, EFLOVER, 0); // Engine Fuel Flow Norm/Override Switches LEFT OFF
// VOICE COMMS CHANNEL SELECTION //
MapKey(&Throttle, EFRNORM, EXEC("if(VerboseOutput) printf(\"Voice Comms: !! EXTERNAL CHANNELS SELECTED !!\\x0a\");")); // Engine Fuel Flow Norm/Override Switches RIGHT [Mic Toggle ON (External/3rd Party)]
// MapKeyR(&Throttle, EFRNORM, 0); // Engine Fuel Flow Norm/Override Switches RIGHT RELEASE
MapKey(&Throttle, EFROVER, EXEC("if(VerboseOutput) printf(\"Voice Comms: !! E:D INTERNAL CHANNEL SELECTED !!\\x0a\");")); // Engine Fuel Flow Norm/Override Switches RIGHT OFF [Mic Toggle OFF (Internal/Default)]
// AUX. HEADLOOK & OPEN MIC GAME CONTROLS //
MapKey(&Throttle, EOLIGN, TEMPO(EXEC("initHeadlookModeSelect();"), PULSE+TrackIRPause, LongPressDelay)); // Engine Operate Ign/Norm LEFT UP [Short: TIR/VR Center] [Long: TIR Pause]
MapKey(&Throttle, EOLNORM, 0); // Engine Operate Ign/Norm LEFT OFF
MapKey(&Throttle, EOLMOTOR, EXEC("initMicCommander();")); // Engine Operate Ign/Norm LEFT DOWN [Toggle between Push-To-Talk & Open Comms]
MapKeyR(&Throttle, EOLMOTOR, EXEC("initMicCommander();")); // Engine Operate Ign/Norm LEFT RELEASE
// SHIP FEATURE FUNCTIONS //
MapKey(&Throttle, EORIGN, TEMPO(EXEC( // Engine Operate Ign/Norm RIGHT UP
"if(!Joystick[S4] & !Joystick[H4P]) initToggleShipLights(1);" // If no Modifier held, default Ship Lights
"if(Joystick[S4]) ActKey(KEYON+PULSE+ChangeWeaponColor);" // If Modifier 1 held, Change Weapon Color
"if(Joystick[H4P]) ActKey(KEYON+PULSE+ChangeEngineColor);"), // If Modifier 2 held, Change Engine Color
PULSE+ShipLights, LongPressDelay)); // [Long: Reset Ship Lights (when out of sync)]
MapKey(&Throttle, EORNORM, 0); // Engine Operate Ign/Norm RIGHT OFF
MapKey(&Throttle, EORMOTOR, EXEC("initToggleRotationCorrection();")); // Engine Operate Ign/Norm RIGHT DOWN
MapKeyR(&Throttle, EORMOTOR, EXEC("initToggleRotationCorrection();")); // Engine Operate Ign/Norm RIGHT RELEASE
MapKey(&Throttle, APUON, EXEC("initToggleSilentRunning();")); // APU START UP
MapKeyR(&Throttle, APUON, EXEC("initToggleSilentRunning();")); // APU START RELEASE
MapKey(&Throttle, APUOFF, 0); // APU OFF DOWN
// EXTERNAL HOTKEY CONTROLS //
MapKey(&Throttle, LDGH, TEMPO(EXEC( // Landing Gear/Warning Silence Button
"if(!Joystick[S4]) ActKey(KEYON+PULSE+TakeSteamScreenshot);" // [Short: Steam Screenshot]
"if(Joystick[S4]) ActKey(KEYON+PULSE+HighResScreenshot);"), // [Short+Pinky: Hi-Res Screenshot (Solo/Private Modes only)]
EXEC(
"if(!Joystick[S4]) ActKey(KEYON+PULSE+GPUCaptureVideoAuto);" // [Long: Save Last xx mins Video Capture]
"if(Joystick[S4]) ActKey(KEYON+PULSE+GPUCaptureManual);"), // [Long+Pinky: Manual Start/Stop Video Capture]
ExtraPressDelay));
// LANDING GEAR & CARGO SCOOP //
MapKey(&Throttle, EACON, EXEC("initToggleLandingGear();")); // EAC ARM UP
MapKeyR(&Throttle, EACON, EXEC("initToggleLandingGear();")); // EAC ARM UP RELEASE
MapKey(&Throttle, EACOFF, 0); // EAC OFF DOWN
MapKey(&Throttle, RDRNRM, EXEC("initToggleCargoScoop();")); // RDR ALTM NRM UP [Deploy Cargo Scoop]
MapKeyR(&Throttle, RDRNRM, EXEC("initToggleCargoScoop();")); // RDR ALTM NRM UP REVERSE
MapKey(&Throttle, RDRDIS, 0);
// AUTOPILOT BUTTON CUSTOM CONFIGURATOR //
MapKey(&Throttle, APENG, TEMPO(EXEC("APSeqShort = 1;" "initAPEngageEnhancer();"), // Autopilot Engage Button
EXEC("APSeqLong = 1;" "initAPEngageEnhancer();"),
LongPressDelay));
// MapKey(&Throttle, APDIS, 0); // Autopilot Disengage Button
// IDLE LOCK CONFIG //
MapKey(&Throttle, IDLELON, EXEC("initIDLEMaster();" "if(VerboseOutput) printf(\"THROTTLE IDLE LOCK: ^^ACTIVE^^\\x0a\");")); // Throttle Idle Detents LEFT ON [Locking (Down): Stationary]
MapKeyR(&Throttle, IDLELON, EXEC("initIDLEMaster();" "if(VerboseOutput) printf(\"THROTTLE IDLE LOCK: *DISABLED*\\x0a\");")); // Throttle Idle Detents LEFT ON RELEASE
// MapKey(&Throttle, IDLELOFF, 0); // Throttle Idle Detents LEFT OFF
// MapKey(&Throttle, IDLERON, 0); // Throttle Idle Detents RIGHT ON (Not used)
// MapKeyR(&Throttle, IDLERON, 0); // Throttle Idle Detents RIGHT ON RELEASE (Not used)
// MapKey(&Throttle, IDLEROFF, 0); // Throttle Idle Detents RIGHT OFF (Not used)
printf("Done... Enhanced ED Script Engineered by Aussiedroid is now running... Fly Safe CMDR! <|>\x0a");
printf("-----------------------------------------------------------------------------------------------------------------------------------------------");
} // end main()
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
// MAP MFD CONTROLS
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
// ** CURRENTLY UNMAPPED **
int initRightMFD() { // Set Right MFD
// MapKey(&RMFD, OSB01, 0);
// MapKey(&RMFD, OSB02, 0);
// MapKey(&RMFD, OSB03, 0);
// MapKey(&RMFD, OSB04, 0);
// MapKey(&RMFD, OSB05, 0);
// MapKey(&RMFD, OSB06, 0);
// MapKey(&RMFD, OSB07, 0);
// MapKey(&RMFD, OSB08, 0);
// MapKey(&RMFD, OSB09, 0);
// MapKey(&RMFD, OSB10, 0);
// MapKey(&RMFD, OSB11, 0);
// MapKey(&RMFD, OSB12, 0);
// MapKey(&RMFD, OSB13, 0);
// MapKey(&RMFD, OSB14, 0);
// MapKey(&RMFD, OSB15, 0);
// MapKey(&RMFD, OSB16, 0);
// MapKey(&RMFD, OSB17, 0);
// MapKey(&RMFD, OSB18, 0);
// MapKey(&RMFD, OSB19, 0);
// MapKey(&RMFD, OSB20, 0);
// MapKey(&RMFD, BRTU, 0);
// MapKey(&RMFD, BRTD, 0);
// MapKey(&RMFD, CONU, 0);
// MapKey(&RMFD, COND, 0);
// MapKey(&RMFD, GAINU, 0);
// MapKey(&RMFD, GAIND, 0);
// MapKey(&RMFD, SYMU, 0);
// MapKey(&RMFD, SYMD, 0);
if(VerboseOutput) printf("Right MFD Configured\x0a"); }
int initLeftMFD() { // Set Left MFD
// MapKey(&LMFD, OSB01, 0);
// MapKey(&LMFD, OSB02, 0);
// MapKey(&LMFD, OSB03, 0);
// MapKey(&LMFD, OSB04, 0);
// MapKey(&LMFD, OSB05, 0);
// MapKey(&LMFD, OSB06, 0);
// MapKey(&LMFD, OSB07, 0);
// MapKey(&LMFD, OSB08, 0);
// MapKey(&LMFD, OSB09, 0);
// MapKey(&LMFD, OSB10, 0);
// MapKey(&LMFD, OSB11, 0);
// MapKey(&LMFD, OSB12, 0);
// MapKey(&LMFD, OSB13, 0);
// MapKey(&LMFD, OSB14, 0);
// MapKey(&LMFD, OSB15, 0);
// MapKey(&LMFD, OSB16, 0);
// MapKey(&LMFD, OSB17, 0);
// MapKey(&LMFD, OSB18, 0);
// MapKey(&LMFD, OSB19, 0);
// MapKey(&LMFD, OSB20, 0);
// MapKey(&LMFD, BRTU, 0);
// MapKey(&LMFD, BRTD, 0);
// MapKey(&LMFD, CONU, 0);
// MapKey(&LMFD, COND, 0);
// MapKey(&LMFD, GAINU, 0);
// MapKey(&LMFD, GAIND, 0);
// MapKey(&LMFD, SYMU, 0);
// MapKey(&LMFD, SYMD, 0);
if(VerboseOutput) printf("Left MFD Configured\x0a"); }
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
// EVENT HANDLER //
//--------------------------------------------------------------------------------------------------------------------------------------------------------------//
int EventHandle(int type, alias o, int x) {
int LED_BRT, TRPCOMBO, Differential_Toe;
if (&o == &Throttle & x == THR_FC & Joystick[S4]) { // Throttle: LED On-The-Fly Backlight Control
LED_BRT = (AxisVal(Throttle[THR_FC], &axdata) - 32766) / 256 * -1; // HOLD S4 (Pinky Trigger) on Joystick & Move Friction Control Axis
ActKey(PULSE+KEYON+LED (&Throttle, LED_INTENSITY, LED_BRT)); }
DefaultMapping(&o, x);
if(UseRuddersT16000 == 1) { // TFRP Rudder: Maps the MODE_FILTERED through Target
if (&o == &TFRPRudder) { // (We can Trim, set Deadzones, J/Scurves, etc.)
GetAxisData(&o, x); // X Axis = Differential combined Toe Brakes, rest at center
if(x == TRPLEFT | x == TRPRIGHT) { // Y Axis = Both Toe Brakes pressed at same time, rest at 0
axdata.locked = 1; // Z Axis = Rudder (as default)
Differential_Toe = -TFRPRudder[TRPRIGHT]/2 + TFRPRudder[TRPLEFT]/2;
GameOutput(&o, TRPRIGHT, AxisVal(Differential_Toe, &axdata));
if (TFRPRudder[TRPLEFT] < TFRPRudder[TRPRIGHT]) TRPCOMBO = TFRPRudder[TRPRIGHT];
else TRPCOMBO = TFRPRudder[TRPLEFT];
GameOutput (&o, TRPLEFT, AxisVal(-TRPCOMBO, &axdata)); }
if(!axdata.locked & !axdata.relative) GameOutput(&o, x, AxisVal(o[x], &axdata)); } }
if(UseRuddersTPR == 1) { // TFRPHA Rudder: Maps the MODE_FILTERED through Target
if (&o == &TFRPHARudder) { // (We can Trim, set Deadzones, J/Scurves, etc.)
GetAxisData(&o, x); // X Axis = Differential combined Toe Brakes, rest at center
if(x == TFRPHA_LEFT | x == TFRPHA_RIGHT) { // Y Axis = Both Toe Brakes pressed at same time, rest at 0
axdata.locked = 1; // Z Axis = Rudder (as default)
Differential_Toe = -TFRPHARudder[TFRPHA_RIGHT]/2 + TFRPHARudder[TFRPHA_LEFT]/2;
GameOutput(&o, TFRPHA_RIGHT, AxisVal(Differential_Toe, &axdata));
if (TFRPHARudder[TFRPHA_LEFT] < TFRPHARudder[TFRPHA_RIGHT]) TRPCOMBO = TFRPHARudder[TFRPHA_RIGHT];
else TRPCOMBO = TFRPHARudder[TFRPHA_LEFT];
GameOutput (&o, TFRPHA_LEFT, AxisVal(-TRPCOMBO, &axdata)); }
if(!axdata.locked & !axdata.relative) GameOutput(&o, x, AxisVal(o[x], &axdata)); } } }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// =============================================================================================================================================================//
// VERSION HISTORY // Version 4.3.0 \\ Released Sept 2016 | Updated Jun 2020 // \\ Public Release #25 //
// =============================================================================================================================================================//
// v4.3 - NEW: Hangar Automation Macro added! Mapped In-game Store Page. Set custom deadzone on Slew on Throttle. FIXED: Joystick 'JS_DEADZONE' not working. //
// v4.3 - FIXED: FastMode Switch Macro for new UI. IMPROVED: Separate Left/Right Throttle axis mapping now possible & Throttle Axis Presets codes been upgraded.//
// v4.2.1-IMPROVED: CruiseOnThrottle now works @ 0% position. FIX: VA Keymappings for Reset HMD Orientation, SRV Throttle Reverse, Exit FSS & Pri/Sec. Fire. //
// v4.2 - NEW: Throttle/Joystick Axis Preset Toggles can now be user defined. NEW: Boost Brake & Turret Mode Cycle Macros. NEW: Disable Left Throttle Axis pref.//
// v4.2 - FIXED: Throttle Modes enforced on both axes, Combined Fire mode now utilises 2-Stage Trigger properly & Mic Push-To-Talk invert fix. //
// v4.1 - APRIL UPDATE NEW: Axis Deadzone Customisation + Disable Message Text Output in TARGET Window via User Prefs. FIXED: UseRudderAxisCurves axis configs. //
// v4.1 - NEW: Galaxy Map Keybind for returning to Current System added. FIXED: FastModeSwitch, NAV Beacon & Report Crimes macro timings 4 new Main Menu layout.//
// v4.0 - NEW: Pulse Repeater Fire! Customisable Auto-Chat Presets, 2 Non-Linear Throttle Presets, SHIFT Key & Hide HUD on NightVision. FIX: LEDs on Launch Seq.//
// v4.0 - IMPROVED: New File Structure, Categorised User Prefs, Table of Contents, Toggle Seq. for Nav Beacon. REMOVED: ChatPresetMode+RepeaterFireMode Presets.//
// v3.3.3-IMPROVED: ED-BAT now opens picture files. FIX: FAOff Printout (UseRudderAxisCurves), VA: 4 Conflict+3 Missing binds. Conflict Discord keymap resolved.//
// v3.3 - BEYOND CH.4: ALL New Keys mapped! NEW: ED-BAT App Launcher, TM TPR Rudder Support, Swap PIP Hat, Report Crimes Macro & LED 'Blinking' Controller. //
// v3.3 - NEW: User Override on Sec. Fire Pinky. IMPROVED: initPrintState formatting & Merged Ship/SRV Cam. FIX: Autodock Macro, C.Scoop LED & ECM duration. //
// v3.2 - IMPROVED: PIP MGT now works first press & FAOFF HOLD Toggle now returns to Previously Active Joystick Curve. FIXED: Multiple Minor Keybind Conflicts. //
// v3.1 - FIXED: Galnet Audio & Escape Vector Sequence conflict. IMPROVED: Combined Fire Trigger behaviour, & Dual Tier PIPs 4xWEP now (2xSYS->2xENG). //
// v3.0.2-BEYOND CH.1: Added User def. Double Tap to Pinky Trigger, NEW Inverted Dual PIP scheme (short=full PIPs), Fighter Follow replaced with Attack. //
// v3.0.1-BEYOND BETA UPDATE: Added the new Galnet Audio keybindings mapped in ED .binds file which are now updated to (v3.0). //
// v3.0 - NEW: Ship Take Off Sequence! UPDATED: Mic Switch Function, Def. VA Toggle Mapping ADD: EDFX/EDDI to SW List FIX: Throttle Prec. Mode preventing Boost.//
// v2.4.3-NEW: Precision C.Scoop Override FIXED: Throttle Toggle @Start, 100% Working TFRP Rudder code! REMOVED: Old Target.tmh (New Ver. Create @ Run/Compile) //
// v2.4.2-NEW: Start Software on Run, LG/CS Toggle Overrides, Jump to Subsystem. IMPROVED: PIP Mapping Code, TFRP Rudder Code & Script Print. FIX: HP Override. //
// v2.4.1-NEW: Clear Chatbox Macro, Precision Cargo Scoop Deploy. IMPROVED: Toggle mechanics FIXED: Mappings HoloMe Rotate, Camera Roll & Digital Ship/SRV Roll.//
// v2.4 - NEW: Auto Timer for Repeater Fire, Fast Menu Switch Macro, VR/TIR Headlook Swap U.Pref SWAP: S.Running/R.Correction Toggles. IMPROVED: Error Handling.//
// v2.3.3-COMBINED FAOFF+ALT FLT (SpeedBrake w/ Pinky Mod) NEW: Escape Macro now has Gear/Scoop Check + new timings. FIX: Chat Macros when Comms Panel is Open. //
// v2.3.2-SWAPPED: Repeater Fire & Combo Fire Modifier buttons. ADD: CruiseOnThrottle check for China Hat, removes FSD as req. FIX: IDLEMaster Function error. //
// v2.3.1-FIXED: 75% Trim T.Preset, + General Comments Cleanup NEW: Macros 2-Tier PIPs (Hold), Swap Joy/Throt Preset Toggles ADD: Chat Macro print layout map. //
// v2.3 - COMMANDERS UPDATE: ADD New Multicrew, HoloME & Camera Suite Keybinds. NEW: Text Chat Macros (PIP Hatswitch+Pinky Trigger). NEW: ShowGameStats Macro. //
// v2.3 - NEW: SC 100% Throttle/Repeater Fire/Signal Light Macros. ADD: 1&2-Tier PIP Alts,User Prefs,MFDs. MOVED: Hardpoints to T.Arm. FIXED: SRV Boost on Slew.//
// v2.2.7-NEW: Heatsink+SilentRunning Mod! FIXED: Dead Throttle on Run/Looping running in Script Editor/Improved FPS/Bandwidth Toggle/Galaxy Map chat conflict. //
// v2.2.6-Changed SRV Digital Steering Hat Switch, Swapped Weapon Fire Group. ADD: Auto-Dock Short/Long press+Pinky. No Shadowplay ref. ADD Fighter Orders. //
// v2.2.5-ADD: Charge ECM button & Fixed Incorrect ED Bindings file in download. //
// v2.2.4-FIXED: Changed Combo Fire Modifier from Pinky to CMS Hat Switch (avoid conflict). Improved PIP timings/refined layout. Removed SRV Handbrake conflict.//
// v2.2 - GUARDIANS UPDATE: ADD Fighters Hotkeys to Trim Hat, Mapped Weapon/Engine Color change. Improved IDLE saftey features. NEW Macros. Public Release! //
// v2.1 - ADD External Keymappings for TrackIR, VoiceAttack & ShadowPlay. SWAP Landing Gear & Silent Running. Changed some delay times. //
// v2.0 - Full script cleanup & formatting update. ADD alt. Macros 4 PIPs & Curves. ADD Reference table for DX Mappings & USB Key Defs. Update .binds to (v2.0).//
// v1.8 - ADD SetThrottle function & Handbrake to Throttle IDLE lock. Ship Lights now dim Throttle LED backlight :) Steam added & Hidden FPS/Ping keys mapped. //
// v1.6 - Improved Toggle switch usage. ADD LED output & expanded script print output in Script Editor. //
// v1.3 - ADD Auto-dock, PIPs Macros & also Joystick & Throttle Curve presets. Plus Subsystem Prev Jump to Powerplant shortcut when holding Prev Subsystem. //
// v1.0 - ADD All Standard KeyMaps, Default Axis settings & Core script structure/defaults. ADD Trigger Combo code. Debug testing. //
// =============================================================================================================================================================//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//------------------------------//
// "I am a leaf on the wind!" //
//------------------------------//