Custom Keystroke Actions |
Keystroke Actions allow you to create responses that would ordinarily require keys on the keyboard to be pressed physically. These include responses such as controlling keyboard-based games, walking through menus with accelerator keys (as in Alt-F,A for “Save As...”), or performing keyboard shortcuts (such as pressing Ctrl-D to tell your e-mail application to delete a message).
A Keystrokes Action consists of the word “Keystrokes” followed by a list of keys to press, enclosed in parentheses. You must use periods (.) to separate individual key presses.
An example of a Keystrokes Action follows:
Keystrokes(Shift+T.H.I.S.Space.I.S.Space.A.Space.T.E.S.T.Period)
Notice in the example above that the word “Space” types a space, not the letters “S-p-a-c-e”; likewise for “Period”. This is because they are the names of special (non-alphanumeric) keys on the keyboard. (For the complete list of such keys, see below under Key Names and Key Codes.) Of course, you can still use Keystrokes to “type” words like “Period” or “Space”; you just have to spell them out with a period (.) separating each letter:
Keystrokes(Shift+T.H.E.R.E.Space.A.R.E.Space.Shift+P.E.R.I.O.D.S.Space.I.N.Space.Shift+S.P.A.C.E.Period)
Keystroke Actions can use an actual keyboard character (for example, the letter “A”), the name of a special key (like “Space” or “Esc”), or a key’s numeric value (such as #92 for the Windows key). When using a numeric value, you must place the pound character “#” before the number. See the table Key Names and Key Codes for a complete list of available keys.