I bought a Warthog in late September and it took me about a full week to get my TARGET profile up and running, as it took me some time to learn how to translate my "thinking in Foxy" into TARGET syntax. Since then, though, DCS was crashing on me every single time I ran it, anywhere from 5 to 30 minutes into a flight. I suspected it was due to my Warthog not being set up correctly and "flooding" DCS with keypresses, but it was only yesterday that I finally got it all worked out and the problem solved.

I figured it might be worthwhile to compile a bunch of the useful info that I've come across in learning about TARGET; if I'd had all this info in one place when I started, I could have saved an immense amount of time. While the official TARGET documentation is useful, I found that it inexplicably left out information that, for my uses at least, was absolutely critical to setting up a profile. If you plan on customizing your HOTAS layout for DCS using TARGET, I would highly recommend that you read its documentation first. After that, but before wasting hours trying to straighten out your confusion, come back here and re-read the info below. I should note that pretty much ALL of the info below comes from other people on this and the ED forums, people like ivanwfr, PeterP, etc. All I've done is gather it all together in one place.

Note that in the following, when I talk about using TARGET, I'm talking about using the Script Editor, not the GUI. Although the GUI is probably 'easier', the Script Editor makes it much easier to utilize the incredible flexibility and power of TARGET.

So here goes:

First and foremost, there seems to be a lot of confusion (myself included, at first) about the different usage options for the Warthog within DCS. They are as allows, in increasing order of complexity:

1. Pure plug-and-play, i.e. pure DirectX mode. The result of an impressive collaboration between Thrustmaster and ED, you can simply plug in the Warthog, completely forget about anything to do with TARGET, and when you start up DCS, "everything just works". All of the buttons and axes on both the joystick and throttle will automatically be assigned to their correct functions in-game. So if you want your Warthog to faithfully mimic the real A-10C HOTAS and not do anything else, this is the option for you.

Although convenient, this method also has the limitation that you cannot utilize 'shifted' button states on the Warthog. Similar to the Cougar, you can use a button such as S3 or S4 to act as your 'shift' toggle, enabling access to a second 'layer' of commands on top of the default 'unshifted' state, and you can also use a switch like the Speedbrake Switch to enable Up / Middle / Down states, which then adds a further two layers (giving a total of 6 possible layers of function assignments). These additional layers will NOT be available to use if you use option #1, however, because DCS does not by default recognize them.

Before going any further, it is important to understand the limitations of using a controller in pure DirectX mode. When DirectX sees a controller that you've plugged in, it will recognize a maximum of 32 buttons and 8 axes on that controller. These can be 'directly' used in-game and are often automatically set to perform certain default functions, e.g. Button1 = DX1 = fire guns. You can also manually assign them in-game in the controller properties page, e.g. click on "Fire guns" and then press Button1 on your controller.

But what happens if you have more than 32 buttons or 8 axes on a single controller? In that case, those 'extra' buttons/axes are not assigned DirectX names, and so from DirectX's perspective, they're not even there. However, you CAN pass keyboard assignments through those buttons/axes, provided you have some programming utility outside of the game (TARGET, Foxy, etc.) that can handle that. So, let's say you have a 33rd button on your joystick. By default, pressing this button in-game will do nothing, because DirectX doesn't see anything beyond 32 buttons. But if you've programmed that button from outside the game to represent, for example, 'G' for landing gear, now when you press that button in-game, the game simply sees 'G' and doesn't care where it came from.

So given all of the above, how does DCS manage this automatic assignment of HOTAS functions on your Warthog? DCS sees your Warthog as two separate devices -- joystick and throttle -- each with up to 32 buttons and 8 axes available. For every device that DCS detects, it creates a separate lua file in C:\Users\[name]\Saved Games\DCS Warthog\Config\Input\A-10C\joystick\, which lists every possible function available within the game, and it is these lua files that change when you manually assign a controller button or axis to a specific command via the in-game controller options. Specific to the Warthog, because DCS 'knows' that your Warthog button is supposed to correspond to a specific function, it automatically assigns the button to do that in the lua file.

Here's an example:

In the Joystick.lua file, if you were using a stick other than the Warthog, you'd see this entry:

Code:
[158] = 
        {
            ["up"] = 351,
            ["name"] = "Weapon release",
            ["category"] = "HOTAS",
            ["down"] = 350,
        }, -- end of [158]


Nevermind the actual numbers (158, 350, 351); what this is showing you is that DCS has a command available called "Weapon release", but that no button on this controller has currently been assigned to it.

If you have a Warthog plugged in, though, you'll see this in your Joystick - HOTAS Warthog.lua file:

Code:
[158] = 
        {
            ["combos"] = 
            {
                [1] = 
                {
                    ["key"] = "JOY_BTN2",
                }, -- end of [1]
            }, -- end of ["combos"]
            ["up"] = 351,
            ["name"] = "Weapon release",
            ["category"] = "HOTAS",
            ["down"] = 350,
        }, -- end of [158]


And this is now showing you that Button2 on the joystick (=DX2) has been automatically bound to the "Weapon release" function; DCS already knows that DX2 on a Warthog joystick is supposed to activate the "Weapon release" function. DCS follows this logic for all the other assignments on the Warthog, and that's how it "just works" when you plug it in for the first time: it will automatically assign the 19 buttons (+POV hat+2 axes) on the joystick and 32 buttons (+POV hat+axes) on the throttle to their appropriate commands within DCS.

2. Plug-and-play with some in-game assignment changes. This one is almost identical to #1 except that now instead of just using all the default controller assignments that DCS has set for your Warthog, you then go into the controller options screen and manually change some of the assignments. You still don't need TARGET or need to muck around with lua files, but again you're going to be limited to only using unshifted button states on your Warthog.

3. Using either joystick or throttle as plug-and-play device, with the other programmed via TARGET. Although I can't readily think of why you'd want to do this, it is possible. This would allow you to have one controller operating as a pure DirectX device (i.e. no shifted states available, and with the 32/8 limitation) with the other being controlled through TARGET and acting as a pure keyboard-emulation device or hybrid DirectX/keyboard-emulation device. In this case, you need to EXCLUDE the 'DirectX-only' controller from your TARGET profile with a line like:

Code:
Configure(&Throttle,MODE_EXCLUDED);


Note that this is also how you exclude your Thrustmaster MFDs, if you have them and want to assign them in-game rather than thru TARGET. In that case you'd use:

Code:
Configure(&LMFD,MODE_EXCLUDED);
Configure(&RMFD,MODE_EXCLUDED);


4. Using both devices through TARGET. This is by far the most flexible and powerful option, and was the way I wanted to go because I knew that even though I wanted the majority of my Warthog's buttons and axes to be assigned realistically, I wanted to customize some of the buttons on both the joystick and throttle beyond what could be done via the in-game controller options.

If you go this route, you're going to have to work on the lua file itself in addition to your TARGET profile. When you set up and run your TARGET profile, DCS is now going to see your Warthog as a 'virtual' controller called "Thrustmaster Combined". Apparently this creates some problems because, while DCS still tries to automatically assign functions to your HOTAS in-game, this can conflict with what you're telling TARGET to do. The result is that you need to make sure your TARGET profile and Thrustmaster Combined.lua files are coordinated (more on that below).

Here's a very important point (first made by ivanwfr): for some reason, if you try to assign actual keypresses to the buttons on your throttle via TARGET (as opposed to simply letting them act as DirectX buttons that can be bound in-game), DCS often has trouble interpreting them correctly and may unintentionally hold them down, so to speak, such that DCS ends up getting 'flooded' by excess keypresses that will eventually crash it. Frustratingly, these 'excess' keypresses are invisible to any keypress analyzers (like TARGET's Event Analyzer) so you won't necessarily know that this is what is crashing your game.

The solution, then, is to try to keep as many of the throttle's buttons and axes operating as DirectX buttons/axes as possible. Thus you must present these buttons as DX buttons to DCS. You can do this in TARGET by simply 'declaring' the correspondence between physical button and DX number, like the following:

Code:
MapKey(&Throttle,FLAPU,DX22);
MapKey(&Throttle,FLAPD,DX23);


And for any buttons or axes on the throttle that you want to assign a more complicated function, you can do that without messing up the other buttons being simple DX buttons. Here's an example that toggles a 'zoom CDU' function on the Mic Switch Down [shifted] button, with the unshifted simply appearing to DCS as DX5, which can then be assigned a function in-game (or via the lua file, which is the same thing):

Code:
MapKeyIO(&Throttle,MSD,SEQ(CHAIN(PULSE+Toggle_zoom,D(150),PULSE+Zoom_CDU),Toggle_zoom),DX5);


But, as I said, you'll want to minimize the use of assignments like the above on the throttle; if at all possible, you should use as many of the allowed 32 DirectX buttons and 8 axes on the throttle and then assign them in-game (i.e. via the lua file). Note that when explicitly passing DX buttons to DCS via TARGET, you now can use shifted states on these buttons, because you're defining the shifted assignment through TARGET (see above example).

At this point it probably makes sense to list the correspondence of DirectX button name with physical button name (inexplicably, this does not appear in the TARGET documentation anywhere!). Note, again, however, that these codes cannot be used together at the same time inside of TARGET, because you're only allowed a total of 32 buttons and 8 axes on your virtual "Combined" controller. The main use for the first list (the 19 DX buttons on the joystick) would be for option #3 above where you make use of the joystick from within TARGET (presumably using a combination of DirectX button assignments and keypress emulation commands) but allow the throttle to "just work" by EXCLUDing it from your TARGET profile and letting DCS see it as a pure DirectX controller.

The second list (the 32 DX buttons on the throttle), however, is useful for most people who would use option #4, combining both controllers in TARGET but keeping most throttle buttons as DX buttons. Note that, if you could somehow create a TARGET profile that included the joystick and throttle as separate DX controllers with all of the assignments below, you'd get the exact same result as option #1 where you simply plug the Warthog in and it "just works" -- because DCS would simply see two separate controllers that are pure DX devices, and it would recognize that it should assign specific DX buttons on each to specific functions in-game.

Joystick:
TG1 = DX1
TG2 = DX6
S1 = DX5
S2 = DX2
S3 = DX3
S4 = DX4

Trim Control
H1U = DXHATUP
H1D = DXHATDOWN
H1L = DXHATLEFT
H1R = DXHATRIGHT

TMS
H2U = DX7
H2D = DX9
H2L = DX10
H2R = DX8

DMS
H3U = DX11
H3D = DX13
H3L = DX14
H3R = DX12

CMS
H4U = DX15
H4D = DX17
H4L = DX18
H4R = DX16
H4P (Hat4 pressed down) = DX19

Throttle:
Slew Control
SC (slew control button pressed in) = DX1

Mic Switch
MSP (mic switch button pressed in) = DX2
MSU = DX3
MSR = DX4
MSD = DX5
MSL = DX6

Speedbrake Switch
SPDF = DX7
SPDB = DX8

Boat Switch
BSF = DX9
BSB = DX10

China Hat
CHF = DX11
CHB = DX12

Pinky Switch
PSF = DX13
PSB = DX14

Left Throttle Button
LTB = DX15

Engine Fuel Flow Norm/Override Switches
EFLNORM = DX16
EFRNORM = DX17

Engine Oper Motor/Norm Switches
EOLMOTOR = DX18
EORMOTOR = Dx19

APU Start/Off Switch
APUON = DX20

Landing Gear Warning Silence
LDGH = DX21

Flaps
FLAPU = DX22
FLAPD = DX23

EAC On/Off
EACON = DX24

RDR/NORM
RDRNRM = DX25

LAAP Autopilot Switches
APENG = DX26
APPAT = DX27
APALT = DX28

Throttle Idle Detents
IDLERON = DX29
IDLELON = DX30

Engine Oper Ign/Norm
EOLIGN = DX31
EORIGN = DX32

Coolie Switch
CSU = DXHATUP
CSR = DXHATRIGHT
CSD = DXHATDOWN
CSL = DXHATLEFT

Continued below...

Last edited by GregP; 11/09/11 02:40 AM.

i7-9700K / MSI MPG Z390 Gaming PRO Carbon AC / 64GB DDR4 / RTX 3080 Ti / TrackIR5 / MFG Crosswind Rudder Pedals / VKB GF MkIII + MCG Pro