-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathElite Dangerous.tmc
More file actions
335 lines (268 loc) · 13.9 KB
/
Copy pathElite Dangerous.tmc
File metadata and controls
335 lines (268 loc) · 13.9 KB
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
include "target.tmh"
//include "combined_pedals_macros.ttm"
include "Elite Dangerous Settings.tmh"
include "Elite Dangerous Keymap.ttm"
include "Elite Dangerous Macros.ttm"
int main()
{
printf("\x0a");
printf("------------------------------------\x0a");
printf("TarodBOFH TARGET Script initializing\x0a");
printf("Elite: Dangerous profile loading\x0a");
printf("------------------------------------\x0a");
printf("\x0a");
//Exclude unuse controllers
Configure(&HCougar, MODE_EXCLUDED); //Exclude Cougar
Configure(&T16000, MODE_EXCLUDED); //Exclude T16000
Configure(&T16000L, MODE_EXCLUDED); //Exclude T16000 Left Hand
Configure(&TWCSThrottle, MODE_EXCLUDED); //Exclude TWCS Throttle (TWCS)
Configure(&LMFD, MODE_EXCLUDED); //Exclude Cougar Left Panel
Configure(&RMFD, MODE_EXCLUDED); //Exclude Couger Right Panel
//Configure(&Throttle, MODE_EXCLUDED); //Exclude Warthog Throttle
//Configure(&Joystick, MODE_EXCLUDED); //Exclude Warthog Joystick
Configure(&TFRPRudder, MODE_EXCLUDED); //Exclude Rudder Pedals
//configureComboPedals(); //Configure Pedals through Tarod's Macro
//Init
if(Init(&EventHandle)) return 1;
initKeyboard();
ActKey(KEYON+PULSE+ keyboard.A);
//Unmap Everything;
UnMapList(&Joystick, &JoystickMap);
UnMapList(&Throttle, &ThrottleMap);
UnMapList(&HCougar, &JoystickMap);
UnMapList(&HCougar, &HCougarMap);
UnMapList(&LMFD, &MFDMap);
UnMapList(&RMFD, &MFDMap);
UnMapList(&T16000, &T16000Map);
UnMapList(&T16000L, &T16000Map);
UnMapList(&TWCSThrottle, &TWCSThrottleMap);
UnMapList(&TFRPRudder, &TFRPRudderMap);
printf("------------------------------------\x0a");
printf("Warming up... setting up lights.\x0a");
printf("Intensity: %d\x0a", LightIntensity);
ActKey(PULSE+KEYON+LED(&Throttle, LED_INTENSITY, LightIntensity)); // Enable LED Backlight on Start (Value 0-255)
//INIT SOME LEDS (the rest are through the macros below)
ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED_CARGO_SCOOP)); // set LED [Cargo Scoop]
ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED_SILENT_RUNNING)); // set LED [Silent Running]
printf("------------------------------------\x0a");
SetKBRate(PulseTime, DelayTime);
SetKBLayout(KBLayout);
//int SetShiftButton(int devI=0, int indexI=0, int devUMD=0, int indexU=0, int indexD=0, int flag=0)
//SetShiftButton(
// &Joystick, //Device IO
// S3, //shift button IO
// &Throttle, //Device UMD
// PSF, //button U
// PSB, //button D
// IOTOGGLE+UDTOGGLE);
SetShiftButton(&Joystick, S4 );
MapAxis(&TFRPRudder, TRUDDER, DX_Z_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
SetSCurve(&TFRPRudder, TRUDDER, 0, 20, 0, 0, 0);
SetJCurve(&TFRPRudder, TRPLEFT, 20, 30);
SetJCurve(&TFRPRudder, TRPRIGHT, 20, 30);
initJettisonProtection();
initJoystickAxis();
initThrottleAxis();
initCustomCommands();
initCombinedFire();
toggleCMSHat();
enhancedFAOFF();
//Mappings
printf("\x0a");
printf("------------------------------------\x0a");
printf("Loading prefs\x0a");
// Map Autopilot Select Toggle to Throttle Axis Presets
MapKey(&Throttle, APPAT, EXEC( // Autopilot PATH UP (+50% Only)
"throttleCurves();")); // Safety: Only Activate When Throttle IDLE is not Locked ON
MapKey(&Throttle, APAH, EXEC( // Autopilot ALT/HDG MIDDLE (Default)
"throttleCurves();")); // Safety: Only Activate When Throttle IDLE is not Locked ON
MapKey(&Throttle, APALT, EXEC( // Autopilot ALT DOWN (Shorter 50% Travel)
"throttleCurves();")); // Safety: Only Activate When Throttle IDLE is not Locked ON
MapKey(&Throttle, IDLERON, EXEC("IDLEMaster();")); // Throttle Idle Detents Right ON [Locking (Down): Stationary]
MapKeyR(&Throttle, IDLERON, EXEC("IDLEMaster();"));
//THROTTLE MAPPINGS
MapKey(&Throttle, SC, EXEC( // Slew Control Button
"if(!Throttle[APALT]) if(!Throttle[IDLERON]) ActKey(KEYON+EngineBoost);")
); // Safety: Won't Boost when in Precise Throttle or IDLE!
MapKeyR(&Throttle, SC, UP+EngineBoost);
//MIC Switch
MapKey(&Throttle, MSU, UIUp); // Mic Switch UP
MapKey(&Throttle, MSD, UIDown); // Mic Switch DOWN
MapKey(&Throttle, MSL, UILeft); // Mic Switch LEFT
MapKey(&Throttle, MSR, UIRight); // Mic Switch RIGHT
MapKeyIO(&Throttle, MSP,
CHAIN(mRequestDock,PULSE+SRVRecallDismissShip),
PULSE+UISelect
);
MapKey(&Throttle, SPDF, EXEC("enhancedFAOFF();")); // Speedbrake Forward TOGGLE ON
MapKeyR(&Throttle, SPDF, EXEC("enhancedFAOFF();")); // Speedbrake Forward TOGGLE RELEASE
MapKey(&Throttle, SPDB, CHAIN(DOWN+FlightAssist, LED(&Throttle, LED_ONOFF, LED_CURRENT-LED_FLIGHT_ASSIST))); // Speedbrake Back HOLD
MapKeyR(&Throttle, SPDB, CHAIN(UP+FlightAssist, LED(&Throttle, LED_ONOFF, LED_CURRENT+LED_FLIGHT_ASSIST))); // Speedbrake Back RELEAS
MapKey(&Throttle, CHF,
TEMPO(
PULSE+UINextPanel,
PULSE+NextFireGroup,
LongPressDelay
)
); // Boat Switch Throttle FORWARD
MapKey(&Throttle, CHB,
TEMPO(
PULSE+UIPrevPanel,
PULSE+PrevFireGroup,
LongPressDelay
)
); // Boat Switch Throttle BACK
//WARNING; CHANGE WITH UIBACK ONCE THEY SUPPORT MULTIPLE PANELS!
MapKey(&Throttle, LTB, CHAIN(
DOWN+ReverseThrottle,
PULSE+UIBack
)
);
MapKeyR(&Throttle, LTB,UP+ReverseThrottle);
MapKey(&Throttle, CSU, PULSE+WingmanNavlock);
MapKey(&Throttle, CSD, PULSE+SelectNextSystemInRoute);
MapKey(&Throttle, CSR, PULSE+SelectNextSubsystem);
MapKey(&Throttle, CSL, PULSE+SelectPrevSubsystem);
MapKey(&Throttle, EFLNORM, EXEC("toggleShipLights();")); // Engine Fuel Flow Norm/Override Switch LEFT
MapKeyR(&Throttle, EFLNORM, EXEC("toggleShipLights();")); // Engine Fuel Flow Norm/Override Switch LEFT RELEASE
MapKey(&Throttle, tSilentRunning, CHAIN(DOWN+SilentRunning, LED(&Throttle, LED_ONOFF, LED_CURRENT+LED_SILENT_RUNNING))); // Engine Fuel Flow Norm/Override Switch RIGHT
MapKeyR(&Throttle, tSilentRunning, CHAIN(UP+SilentRunning, LED(&Throttle, LED_ONOFF, LED_CURRENT-LED_SILENT_RUNNING))); // Engine Fuel Flow Norm/Override Switch RIGHT RELEASE
MapKeyR(&Throttle, BSB, TargetPanel); // Boat Switch Throttle FORWARD
MapKeyR(&Throttle, BSF, SystemPanel); // Boat Switch Throttle BACK
MapKeyRIO(&Throttle, PSF,
SystemMap,
CommsPanel); // Pinky Switch Throttle FORWARD
MapKeyRIO(&Throttle, PSB,
GalaxyMap,
RolePanel); // Pinky Switch Throttle BACK
MapKeyR(&Throttle, EOLMOTOR, GalaxyMap); // Engine oper LEFT DOWN
MapKeyR(&Throttle, EORMOTOR, SystemMap); // Engine oper RIGHT DOWN
MapKey(&Throttle, BSB, 0); // Boat Switch Throttle FORWARD
MapKey(&Throttle, BSF, 0); // Boat Switch Throttle BACK
MapKey(&Throttle, PSF, 0); // Pinky Switch Throttle FORWARD
MapKey(&Throttle, PSB, 0); // Pinky Switch Throttle BACK
MapKey(&Throttle, EOLMOTOR, 0); // Engine oper LEFT DOWN
MapKey(&Throttle, EORMOTOR, 0); // Engine oper RIGHT DOWN
//OLD MAPPINGS APTEPMTS
//Panel Management: On panel close, restore other panel status
//When ED supports multiple panels open at same time, replace back with same key EXCEPT galaxy&system map
//MapKey( &Throttle, BSB, DOWN+TargetPanel); // Boat Switch Throttle FORWARD
//MapKeyR(&Throttle, BSB, UP +TargetPanel); // Boat Switch Throttle FORWARD
//MapKey( &Throttle, BSF, DOWN+SystemPanel); // Boat Switch Throttle BACK
//MapKeyR(&Throttle, BSF, UP +SystemPanel); // Boat Switch Throttle BACK
//MapKey( &Throttle, PSF, DOWN+SystemMap);
//MapKeyR(&Throttle, PSF, UP +SystemMap);
//MapKey( &Throttle, PSB, DOWN+GalaxyMap);
//MapKeyR(&Throttle, PSB, UP +GalaxyMap);
//MapKey( &Throttle, EOLMOTOR, DOWN+CommsPanel);
//MapKeyR(&Throttle, EOLMOTOR, UP+CommsPanel);
//MapKey( &Throttle, EORMOTOR, DOWN+RolePanel);
//MapKeyR(&Throttle, EORMOTOR, UP+RolePanel);
//MapKey( &Throttle, EORNORM, 0);
//MapKey( &Throttle, EOLNORM, 0);
//MapKey(&Throttle, BSM, EXEC("panelClose();")); // Boat Switch Throttle MIDDLE [Centering Switch will Exit Panels]
MapKey(&Throttle, LDGH,
TEMPO(
PULSE+DeployHardpoints,
PULSE+FighterOrders,
LongPressDelay
)
);
MapKey(&Throttle, FLAPU, EXEC("setJoystickCurves();")); // Flaps UP
MapKey(&Throttle, FLAPM, EXEC("setJoystickCurves();")); // Flaps MIDDLE
MapKey(&Throttle, FLAPD, EXEC("setJoystickCurves();")); // Flaps DOWN
MapKey(&Throttle, EACON, PULSE+LandingGear ); // EAC ARM UP
MapKeyR(&Throttle, EACON, PULSE+LandingGear); // EAC ARM UP RELEASE
MapKey(&Throttle, EACOFF, 0); // EAC OFF DOWN
MapKey(&Throttle, RDRNRM, EXEC("toggleCMSHat();")); // EAC ARM UP
MapKeyR(&Throttle, RDRNRM, EXEC("toggleCMSHat();")); // EAC ARM UP RELEASE
//MapKey(&Throttle, RDRDIS, 0); // EAC OFF DOWN
MapKeyIO(&Throttle, APENG,
CHAIN(PULSE+ShowFramerate, D(),PULSE+ShowConnectionStatus),
TEMPO(
PULSE+Supercruise,
PULSE+FrameShiftDrive,
LongPressDelay
)
);
//JOYSTICK
MapKey(&Joystick, S4, EXEC("shiftControl();")); //In addition to being modifier, it controls state of what it is modifying
MapKey(&Joystick, TG1,DOWN+PrimaryFire);
MapKeyR(&Joystick, TG1, UP+PrimaryFire);
//MapKey(&Joystick, TG2,EXEC("hardpoints();"));
MapKey(&Joystick, CMSP, EXEC("toggleCombinedFire();"));
MapKeyIO(&Joystick, S2,
EXEC("hardpoints();"),
TEMPO(
PULSE+SelectTargetAhead,
PULSE+SelectHighestThreat,
LongPressDelay
)
);
MapKeyIO(&Joystick, S3,
TEMPO(
CHAIN(PULSE+ResetHeadOrientation,PULSE+TrackIRCenter),
PULSE+Screenshoot,
LongPressDelay),
DOWN+SecondaryFire
);
MapKeyRIO(&Joystick, S3,
0,
EXEC("checkSecondaryFire();")
);
MapKeyR(&Joystick, TG2, CHAIN(
EXEC("checkSecondaryFire();"), //Do not release if still doing sec fire
DOWN+PrimaryFire)
); //We pass through TG1 after releasing TG2...
MapKeyIO(&Joystick, S1,
TEMPO(
PULSE+OrbitalLines,
PULSE+HideShipGUI,
LongPressDelay),
TEMPO(
PULSE+SRVTurret,
EXEC("hardpoints();"),
LongPressDelay)
);
MapKeyIO(&Joystick, TrimSwitchU,
PULSE+SelectWingman1,
DXHATUP);
MapKeyIO(&Joystick, TrimSwitchD,
PULSE+WingmanTarget,
DXHATDOWN);
MapKeyIO(&Joystick, TrimSwitchL,
PULSE+SelectWingman2,
ThrustLeft);
MapKeyIO(&Joystick, TrimSwitchR,
PULSE+SelectWingman3,
ThrustRight);
MapKeyIO(&Joystick, DMSU,
TEMPO(PULSE+FighterFollow, PULSE+FighterOrders, PIPPressDelay),
TEMPO(mPowerEngSys, mPowerEngWep, PIPPressDelay)
);
MapKeyIO(&Joystick, DMSR,
TEMPO(PULSE+FighterAggressive,PULSE+FighterFocus, PIPPressDelay),
TEMPO(mPowerWepEng, mPowerWepSys, PIPPressDelay)
);
MapKeyIO(&Joystick, DMSL,
TEMPO(PULSE+FighterDefensive,PULSE+FighterHoldFire, PIPPressDelay),
TEMPO(mPowerSysEng, mPowerSysWep, PIPPressDelay)
);
MapKeyIO(&Joystick, DMSD,
TEMPO(PULSE+FighterDock, PULSE+FighterHoldPosition, PIPPressDelay),
TEMPO(BalancePower, mPowerFlee, PIPPressDelay)
);
MapKey(&Joystick, CMSU,EXEC(" if(Throttle[RDRNRM]) ActKey(KEYON+PULSE+DeployHeatSink);"));
MapKey(&Joystick, CMSR,EXEC(" if(Throttle[RDRNRM]) ActKey(KEYON+PULSE+FireChaffLauncher);"));
MapKey(&Joystick, CMSL,EXEC(" if(Throttle[RDRNRM]) ActKey(KEYON+PULSE+UseShieldCell);"));
MapKey(&Joystick, CMSD,EXEC(" if(Throttle[RDRNRM]) ActKey(KEYON+PULSE+ChargeECM);"));
MapKey(&Joystick, TMSU, PULSE+SelectNextHostileShip);
MapKey(&Joystick, TMSD, PULSE+SelectPrevHostileShip);
MapKey(&Joystick, TMSL, PULSE+SelectPrevShip);
MapKey(&Joystick, TMSR, PULSE+SelectNextShip);
}
int EventHandle(int type, alias o, int x) {
//this function consumes the event
//if (combinePedals(type,&o,x)) DefaultMapping(&o,x);
DefaultMapping(&o, x);
}