Difference between revisions of "LASTKEY()"

From Recital Documentation Wiki
Jump to: navigation, search
(Class)
 
Line 1: Line 1:
 
 
 
==Purpose==
 
==Purpose==
 
Function to return ASCII code for last key pressed
 
Function to return ASCII code for last key pressed
Line 58: Line 56:
  
 
==Products==
 
==Products==
Recital Mirage Server, Recital Terminal Developer
+
Recital  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:Keyboard Events]]
 
[[Category:Keyboard Events]]
 
[[Category:Keyboard Events Functions]]
 
[[Category:Keyboard Events Functions]]

Latest revision as of 16:54, 2 December 2009

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