LASTKEY()

From Recital Documentation Wiki
Revision as of 12:18, 23 March 2009 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Class

Keyboard Events


Purpose

Function to return ASCII code for last key pressed


Syntax

LASTKEY([<expN>])


See Also

CTRL(), INKEY(), MESSAGE, NEXTKEY(), READKEY(), SET KEY, SET PCKEYS


Description

The LASTKEY() function returns the ASCII code for the last key which was pressed at the keyboard. If the optional <expN> is passed, the next LASTKEY() return value will be set to this value. This function is useful for returning the key pressed in response to the DIALOG MESSAGE command. The LASTKEY() function can also be used in conjunction with the CTRL() function for terminal independent programs. The CLEAR TYPEAHEAD commands clears the LASTKEY() function to zero.

When used in Recital Mirage in conjunction with INKEY(<expN>,"M"), LASTKEY() returns a numeric value indicating the last mouse operation as shown in the table below.


LASTKEY() Return Value Mouse Operation
151 LEFTCLICK
152 RIGHTCLICK
153 DBLCLICK
154 CTRL+LEFTCLICK
155 CTRL+RIGHTCLICK
156 CTRL+DBLCLICK
157 SHIFT+LEFTCLICK
158 SHIFT+RIGHTCLICK
159 SHIFT+DBLCLICK
160 ALT+LEFTCLICK
161 ALT+RIGHTCLICK
162 ALT+DBLCLICK


Example

dialog message "Do you wish to continue?  (Y or N)."
a = iif(lastkey()=asc("Y"),"program continuing", "program ending")
set message to "&a"


Products

Recital Mirage Server, Recital Terminal Developer