Contents

Previous

Next

Last

Programming Character Macros

One of the primary functions of the Control Manager is to allow you to send keystrokes when a button or hat position is pressed. This allows you to perform several operations such as activating functions in the game which can't be operated using direct button inputs, programming a single buttons to perform multiple operations, or sending "canned" messages to other players in a multiplayer environment.

General Information

All of macros are entered in much the same way. The Control Manager provides Edit Boxes for the macros. You place the cursor in the box and type in the characters you want to send. You can also use the Keystroke Recorder as an aid to entering macros quickly.

In general, there are four such boxes for each button or hat position. These appear when the "DirectX Mode" box at the top of the Dialog Pane is unchecked. Two of the boxes define the macros to be sent when the "Shift" button is released (Normal Action), two of the boxes define those sent when the "Shift" button is pressed (Shifted Action). In each of the two groups, there are two boxes. One defines the macro that will be sent when the selected button is pressed, the other defines the macro sent when the selected button is released.

For the most part, the keystrokes in a macro are simply entered using the character you want to send, e.g. "a". In some cases, the keystroke is a "named" key. This is used for keys that don't have a single character name such as "LSHF" for "Left Shift", "RALT" for "Right Alt", etc.

The macros fall into one of three categories. These are termed "Regular Macros", "HOLD Macros", and "KEYS Macros". Which you use depends on what you need to accomplish. This section will talk about each type in turn. Note that the example macros will be enclosed in double-quotes, e.g. "xyz". The quotes are there to delineate the macro and should not be entered in a real macro, unless of course you really need to send a double quote.

Regular Macros

Regular Macros are by far the most common. These are used for sending single or repeating characters, or for sending simple strings of characters such as "abc". When you enter the macro into its' Edit Box, you must separate the characters with a space character so that the Control Manager can differentiate between a character and a named character or keyword. For example, you would enter "L S H F" if you wanted to send "LSHF" with a particular button. If you actually entered "LSHF" in the Edit Box, you would get the Left Shift key instead.

Upper and Lower Case

The Control Manager understands the difference between upper-case and lower-case characters and will insert the appropriate shift key when needed. For example, suppose you enter "A" as a macro. When the map is activated, the Control Manager will actually press the left shift key, press the "a" key, release the "a" key, and release the left shift key. You should keep this in mind when programming since most game instruction manuals will show the upper case version when they actually want the lower case version, and in many cases the upper-case version will not result in the correct action. For example, a game might specify "Flaps: F" when it actually means "Flaps: f". As a general rule, use the lower-case form of the character unless the manual specifically states otherwise, e.g. "Flaps: Shift-F". You'll be right more often than wrong.

Named Keys

As mentioned above, each character in the Regular Macro must be separated by a space. To actually send the space character, you have to use the named key "SPC". For example, "H i SPC t h e r e !" would produce "Hi there!" when the button was pressed. There are several named keys. For a complete listing, consult the Control Manager Keycodes section.

Modal Keys

While you can enter a shifted character by simply entering its upper-case representation, there are two other types of keys that are similar to the shift key in that they are held while the key is pressed. These are the Alt and Control keys. These, along with the Shift key are termed "Modal Keys" because they are not sent singly but rather held down while the associated key is pressed. These are designated by the three modal indicators "SHF", "ALT", and "CTL" and are used by preceding the actual character. For example "CTL c" will result in a "Control-c" being sent. The SHF modifier is not generally necessary except for named keys, "SHF F4" for example, since there is no Upper Case F4.

The Left and Right Shift, Alt, and Control keys can also be sent as single characters. To differentiate these from the Modal keys, they are preceded with an "L" or an "R" denoting Left or Right. For example "LSHF", "RALT", etc. When used this way, the designated key is pressed and then released rather than being held while the next key in the macro is pressed.

Repeating Keys

Normally, a macro with just a single character (and possibly a Modal modifier) is entered for a macro it is sent as a repeating character. If you hold the button down, the character will repeat indefinitely. It's worth noting that the USB system handles repeating characters somewhat differently than the older PS2 keyboards did. With the PS2, the keyboard actually did send the repeated "Make" keys while the key was held down. Under USB, the key only sent once. The system itself generates the repeats based on the repeat rate setting in the Windows Keyboard Properties. Macro that contain multiple keys are only sent one time, no repeat is generated.

Non-Repeating Single Keys

In many cases, a repeating character can be a bothersome thing. For example, if you have a key that lowers your landing gear, you probably only want to lower it one time. A repeating key may lower on the first instance of the key, then raise it again on the second, and so on. To get around this, there is a named character termed the "Null Character". It's represented as "NULL". The Null Character does not actually send anything, it's generally ignored by the Control Manager except that it is counted as a character when the Control Manager determines whether to send a repeating single key or a non-repeating macro string. For example, "a" will result in the button sending "aaaaaaaaaaaaa" where "NULL a" will result in just a single "a" being sent.

HOLD Macros

HOLD Macros are used where it is necessary to hold down more than a single key at one time. This can be useful in certain situations, particularly where a game requires perhaps a "Right-Shift F4". The normal SHF modifier generates a Left-Shift and "RSHF F4" generates two individual characters. The HOLD macro can work around this. To enter a HOLD macro, just start the macro with the word "HOLD", e.g. "HOLD RSHF F4" will result in both keys going down simultaneously.

KEYS Macros

The third, and probably the most flexible, of the macro types is the "KEYS" macro. It specifically defines the ordering of presses and releases of the various keys using a "+" or "-" character. To use the KEYS macro, you start the macro with the word "KEYS". For example "KEYS +a +b -a +c -b -c". This would result in "a" being pressed, "b" being pressed, "a" being released, "c" being pressed, "b" being released, and "c" being released.

In the KEYS macro you must specify every keystroke in the correct order. It is possible to leave a key "stuck" down, for example "KEYS +a" never releases the "a" key and it will be stuck until the "a" key is pressed on the keyboard or until, perhaps, another button press activates a "KEYS -a" macro. This can be useful or not, depending on what it is you're trying to accomplish. You might want to hold "a", "b", and "c" down while a button is down, releasing it when the button comes up, for instance. In that case you might define the buttons "press" macro as "KEYS +a +b +c" and the "release" macro as "KEYS -a -b -c". The Keystroke Recorder is very useful in generating this sort of macro.