Keys

(Engine-Level Function)

Description Returns the most recently pressed keys, optionally flagging virtual key codes.
Returns Text
Usage Script or steady state.
Function Groups Keyboard,  String and Buffer
Related to: KeyFake | KeyCount | MatchKeys
Format: Keys(N, Option)
Parameters  
N
Any numeric expression giving the number of keys to get.
Option
Any logical expression indicating whether edited mode or non-edited mode should be used.  Set to TRUE for the non-edited mode.
Comments In the non-edited mode, function keys and others that return a virtual key code will have a 0xFD (253) pre-pended to the return value. (See Microsoft's online MSDN reference for a list of virtual key codes.)   Because of this, the return value may contain more bytes than specified by the parameter, N.

Examples:

nonEditPressed = Keys(5, 1);

This sets nonEditPressed to a text string containing the key codes for the last five keys pressed, in order from oldest to most recently pressed. 

In Edited Mode, the keys [a][b][c][up-arrow][d] results in the buffer, 61 62 63 64.

In Non-edited mode, [a][b][c][up-arrow][d] results in 61 62 63 FD 48 64.