AIT_VerifyKeyState

Description

Checks whether the key status is the same as that on the keyboard.

Format

integer AIT_VerifyKeyState  (
 integer nVirtualKey,     // Virtual key
 integer nKeyState        // Key status
);

Parameters

nVirtualKey (input)

Specify a virtual key having key status to be checked.

You have to set one of the following values.

ValueDescription
NUMLOCKNum Lock key
SCROLLLOCKScroll Lock key
CAPSLOCKCaps Lock key

nKeyState (input)

Specify key status to be checked, which is on or off. You have to set one of the following values.

ValueDescription
KEYSTATE_OFFSpecify this value to check whether the key is off.
KEYSTATE_ONSpecify this value to check whether the key is on.

Return values

The return value is 1 if the key status matches specified status, 0 if not, and -1 if the function has not been processed successfully. If -1 has been returned, you can use AIT_GetLastError to acquire an extended error code. The following gives the error codes that AIT_GetLastError might return:

Extended error numberError code
8ERROR_NOT_ENOUGH_MEMORY
14ERROR_OUTOFMEMORY
87ERROR_INVALID_PARAMETER
112ERROR_DISK_FULL
1400ERROR_INVALID_WINDOW_HANDLE
1460ERROR_TIMEOUT