Script Language: Expressions: Key Codes
|
![]() |
In order to represent key codes simply and efficiently, there is a special syntax for key codes, also known as action codes. Here are a few examples: <ENTER> <CTRL ENTER> <4> <SHIFT A> <"$"> <CTRL ALT F1> <-4> <A> Key codes are often useful inside input handler scripts that are
called directly by the interpreter (such as the menu handler that is specified
with the Key code identifiers are separate from the game's namespace, so there is no threat of conflict when declaring other identifiers that share the same name as a key code. Mouse Buttons<LBUTTON> <MBUTTON> <RBUTTON> Key codes are used to represent mouse buttons as well as keyboard keys,
and in fact, there is no distinction in AGAST between a mouse button and
a keyboard key. If you would rather use a numeric scheme to address your
mouse, the left mouse button is also Mouse Wheel>pre> <MOUSEWHEEL> <-MOUSEWHEEL><MOUSEWHEEL>, or <+MOUSEWHEEL>
means roll up, <-MOUSEWHEEL> means roll down.
You can also abbreviate it to just <WHEEL>.
Digits (not on the keypad)<0> to <9> Use a letter or digit to represent its keyboard key. To specify an uppercase
letter, you must use the shift keyword as in Named Keys<BACKSPACE> <TAB> <PAUSE> <SPACE> <PGUP> <PGDN> <END> <HOME> <LEFT> <UP> <RIGHT> <DOWN> <INS> <DEL> <ESC> These keys are all found west of the number pad. Function Keys<F1> to <F24> These represent the functions keys. Of course, very few keyboards support 13 through 24. Numeric Keypad<NUMPAD0> to <NUMPAD9> <MULTIPLY> <ADD> <SUBTRACT> <DECIMAL> <DIVIDE> These keys are all found on the number pad. Except for SymbolsTo use the symbol keys such as colon, percent, or tilde, you have to
enclose the symbol in double quotes: Special Key-Codes<DRAW> One key-code does not represent a key at all, but a menu action. The interpreter sends a
See Also... |
![]() |
![]() ![]() ![]() ![]() ![]() |