lastkey Parameter

Displays the last key obtained by keyread or lineread.

Scope: Global

Syntax

query lastkey 

Description

The lastkey parameter displays the name of the key read by the most recent keyread command, or the key used to terminate the most recent lineread command, whichever occurred last.

If the lineread dialog is used, pressing its OK and Cancel buttons return the values as Enter and Escape respectively.

The possible names returned by this command are:

nnn 
A decimal-based ASCII character code, where n is a digit of value 0 to 9, inclusive. For example, character code 065 = A.
xnn 
xnnn 
A hexadecimal-based ASCII character code, where n is a digit of value 0 to 9, inclusive, or an alphabetic character of value A to F or a to f, inclusive. For example, character code x41 = A.
any key
Any keyboard character.
c-a to c-z 
Ctrl+letter keys
c-0 to c-9 
Ctrl+number keys. (The number keys on the numeric keypad are excluded.)
a-a to a-z 
Alt+letter keys
a-0 to a-9 
Alt+number keys. (The number keys on the numeric keypad are excluded.)
f1 to f12 
Function keys
s-f1 to s-f12 
Shift+Function keys
c-f1 to c-f12 
Ctrl+Function keys
a-f1 to a-f12 
Alt+Function keys
a named key 
The following key names can be used, either alone or in combination with the Alt or Ctrl keys:
Backspace
Tab
Backtab
Enter
Esc
PadEnter

The following key names can be used, either alone or in combination with the Alt, Ctrl, or Shift keys:

PgUp
PgDn
End
Home
Left
Up
Right
Down
 
Ins
Del
 
<null>
If either of the keyread or lineread commands were not previously called.

Example

To return the last key obtained by keyread, type:

query lastkey 

API Return Code

-1 
You cannot issue the set command for this parameter.

keyread Command
lineread Command