Description: This function returns the most recently pressed keys from either the edited or non-edited keystrokes.
Returns: Text
Usage: Script or Steady State.
Format: Keys(N, Option)
Parameters: N { numeric } { required } { no default }
Any numeric expression giving the number of keys to get.
Option { Boolean } { required } { no default }
Any logical expression. If true, non-edited keystrokes are returned; if false, edited keystrokes are returned.
Comments: Non-edited keystrokes may contain extended key codes. An extended key code consists of two bytes, rather than one, so there may be more characters returned than keys pressed. The first byte of an extended key code is always 253. The second byte indicates the key. The easiest way to find an extended key code for a special or function key is to use the F1 help key. This will return the corresponding one or two byte key code for each key pressed.
Examples:
nonEditPressed = Keys(1, 1);
This sets nonEditPressed to a text string containing the most recently pressed non-edited key code. Another example of this would be:
nonEditPressed = Keys(5, 1);
Here, nonEditPressed will be set to a text string containing the five most recently pressed non-edited key codes, in order from oldest to most recently pressed.
See Also:
KeyFake | KeyCount | MatchKeys | ReadNum | ReadText