This repository has been archived by the owner on May 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tmc
53 lines (45 loc) · 1.83 KB
/
main.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
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42mk1):
* <bastian@codename-php.de> wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return Bastian Schwarz.
*
* If you don't want to buy me a beer, consider buying one for Poul-Henning Kamp
* for creating this licence.
* ----------------------------------------------------------------------------
*/
/*
* This is the main file of the profile. Run this in your T.A.R.G.E.T. software.
* The profile is intended to be compatible with the Thrustmaster HOTAS Cougar
* and the default button mapping in DCS World 2.5 and up
*/
include "target.tmh" //inlcude TM default stuff
include "mappings/dcs/dx.ttm" // maps DCS commands to DX codes
include "throttle.tmh"
stGameCfg morebuttons = { 100, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0};
int main() {
configureDevices();
if(Init(&EventHandle, 0)) return 1; // declare the event handler, return on error
PlugGame(&morebuttons, "Virtual Warthog for DCS");
initThrottle();
}
//event handler
int EventHandle(int type, alias o, int x) {
DefaultMapping(&o, x);
}
/*
* We want to handle most things directly with directX and we are only interested in Warthog stick and throttle
*
* I tried to add the throttle as "filtered" but DCS did not recognize any axis or button inputs, so I guess i will map the throttle to
* the virtual device
*/
int configureDevices() {
Configure(&LMFD,MODE_EXCLUDED);
Configure(&RMFD,MODE_EXCLUDED);
Configure(&HCougar,MODE_EXCLUDED);
Configure(&T16000,MODE_EXCLUDED);
Configure(&T16000L,MODE_EXCLUDED);
Configure(&TFRPRudder,MODE_EXCLUDED);
Configure(&Joystick,MODE_EXCLUDED);
}