Older Newer
Sat, 16 Nov 2019 02:36:20 . . . . SyneRyder [Fix link to MSDN, formatting]


Changes by last author:

Added:
= getAsyncKeyState =

== Syntax ==

int getAsyncKeyState (int vkey)

== Arguments ==

:vkey

::Virtual Key Constant. For more information see the [MSDN Virtual Key Codes page]

== Return ==

The return value specifies whether the key was pressed since the last call to GetAsyncKeyState, and whether the key is currently up or down. If the most significant bit is set (ie is less than zero on a signed integer), the key is down, and if the least significant bit is set, the key was pressed after the previous call to GetAsyncKeyState.

== Description ==

Determines whether a key is up or down at the time the function is called, and whether the key was pressed after a previous call to getAsyncKeyState.

== Example ==

<code>

%ffp

ctl[10]: PUSHBUTTON, Text="Hold down the CTRL key and click me", pos=(250,50), size=(150,15)

OnCtl(n):

{

int r;

if (n==10 && e == FME_CLICKED) {

if (getAsyncKeyState(VK_CONTROL) < 0)

Info ("The Control Key was just pressed.");

else

ErrorOk ("You didn't press the Control Key.");

}

return false;

}

</code>

== See Also ==

getAsyncKeyStateF, VK codes