GoFiler Legato Script Reference
Legato v 1.5b Application v 5.24b
|
Table of Contents | < < Previous | Next >> |
Chapter Fifteen — Windows/OS Functions (continued)
Overview
The IsKeyPressed function tests a specified virtual key as being pressed or down on the keyboard.
Syntax/Parameters
Syntax
boolean = IsKeyPressed ( int vkey );
Parameters
vkey
An int specifying a virtual key position. The VK_ keys can be found in the SDK listed in Appendix A — Legato SDK Standard Definitions.
Return Value
Returns a boolean value as TRUE if the specified key is down or FALSE if it is not.
Remarks
The IsKeyPressed function asynchronously reads the keyboard without regard to which application has keyboard focus. It also does not remove the key, or interfere with, the keyboard message queue. It is not meant to perform general keyboard input but rather allow a script to peek at the state of the keyboard.
The return value specifies whether the key was pressed since the last call to IsKeyPressed, and whether the key is currently up or down.
The IsKeyPressed function also works with mouse buttons. However, it checks on the state of the physical mouse buttons, not on the logical mouse buttons that the physical buttons are mapped to. For example:
if (IsKeyPressed(VK_LBUTTON)) { ...
always returns the state of the left physical mouse button, regardless of whether it is mapped to the left or right logical mouse button.
Although the least significant bit of the return value indicates whether the key has been pressed since the last query, due to the pre-emptive multitasking nature of operating systems, another application can read the keyboard state and receive the “recently pressed” bit instead of your application.
Scripts can use the virtual-key code constants VK_SHIFT, VK_CONTROL, and VK_MENU as values for the vkey parameter. This gives the state of the Shift, Ctrl, or Alt keys without distinguishing between left and right. You can use the following virtual-key code constants as values for vkey to distinguish between the left and right instances of those keys.
Certain functions, such as for the progress display will read keys such as Escape and perform certain actions such as returning ERROR_CANCEL.
Related Functions
Platform Support
Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL
Legato IDE, Legato Basic
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.