Button and Keyboard Mapping
When you first install the Targetware system, all
important game functions are already mapped to various
keyboard keys and joystick buttons, as detailed in
the Default Controls
page. You are not limited to these settings, however.
You can assign any game function to just about any
key on your keyboard, or any button on your joystick,
throttle, or game pad. This section will explain how
to edit the input.txt text file that
contains the control key mapping data use by the game.
Note:
You do not have to edit key/button mappings
by hand. You can use the Settings section of Targetware
to change stick settings and key assignments in a
point-and-click environment. See Keys,
Controls, and Calibration for more information.
This reference is to assist those who wish to edit
their input.txt files by hand.
See the Default Controls page
to see how the keyboard and joystick buttons are mapped by default. Anything
you see on that list, you can customize.
The Input File
The Input file governs the use of all the
hardware that interacts with the game: keyboard, mouse,
joysticks, etc. It is a simple text file that
can be modified with any text editor. The Input
file is divided into several sections based on function.
Each line contains a description on the left, and
a code describing the button or key it is mapped to,
on the right. To change a setting, simply edit the
key or button assignment, then save the changes
to the file. The changes you made will take effect
the next time you start up the Targetware application.
Joystick Button Names
The input file uses the following format to refer to joystick buttons:
JS_[device #]_BUTTON_[button #]
So to map a function to a joystick button, you need
to know the device number of your joystick and the
button number that corresponds to the button on your
joystick that you want to use. Unfortunately, since
joystick manufacturers all use different schemes to
report the names of their joystick buttons, you will
probably have to find the names of your joystick buttons
through trial and error.
MAC VERSION ONLY: The Mac version of the game will report the names of all input devices and their buttons on startup, if you have the log level set to 4. To find the available button "names" for your joystick, make sure it is plugged in, then start up the game and quit immediately. Open the log, and you should see something like this near the top of the file (it will differ for every stick):
4 Device "WingMan Extreme Digital 3D" stored as Device 1
<SNIP>
Name discovered as "Button #1" on Device 1 with usagePage 0x9, usage 0x1 stored as Button, index 0
Name discovered as "Button #2" on Device 1 with usagePage 0x9, usage 0x2 stored as Button, index 1
Name discovered as "Button #3" on Device 1 with usagePage 0x9, usage 0x3 stored as Button, index 2
Name discovered as "Button #4" on Device 1 with usagePage 0x9, usage 0x4 stored as Button, index 3
This tells you that if you wanted to program "Button #3" on your WingMan Extreme joystick to be the Fire button, you would need to use a joystick (DEVICE) ID of 1, and a button ID of 2, as follows:
Fire = JS_1_BUTTON_2
Special Key Names
Most keys can simply be entered as they appear on the keyboard. For example,
the "A" key on your keyboard would simply be "A" in
the input.txt file. But some keys, such as the Spacebar
and the Enter key, have specific codes they should
be referred to as:
| Tab key | TAB |
| Enter/Return key | ENTER |
| Esc key | ESCAPE |
| Cursor keys | UP, DOWN, LEFT, RIGHT |
| Spacebar | SPACE |
| Function keys | F1, F2, F3, etc. |
| Numeric keypad keys | PAD_ + key name |
| Control key | CTRL |
| Shift key | SHIFT |
| Alt/Option key | ALT |
Custom Mapping Examples
Changing key assignments is very simple with Targetware.
Simply open the Input file, find the function
you wish to change, and just enter the key or button
you want to use for that function.
Example 1: Mapping to a Single Key
To have the Chat console open when you press the Enter (Mac: Return) key, find the Chat line:
Chat = T
Edit it to read:
Chat = ENTER
Example 2: Using a Key Modifier
Say you have mapped everything, and now you are running out of keys on your keyboard. One solution is to use modifier keys like the Shift key, Control key, and Alt (Mac: Option) key. The format for this in the input.txt file is MODIFIER KEY + ACTIVATOR KEY NAME. In this example, we want to have the bomb bay doors open when we hold down the Control key and press "O":
Toggle Bays = CTRL+O
Example 3: Assigning a Function to a Joystick Button
We used the bomb bay door setting from example 2, but found it too complex to handle on our bomb run. Using our MegaStick 3000, we'll assign it one of our 124 buttons instead:
Toggle Bays = JS_1_BUTTON_14
This line can be interpreted as: "Map the bomb bay door switch to Button #14 on the first joystick."
Note:
Be very careful when customizing your inputs that you do not map multiple
functions to the same key.
|