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.
Value | Description |
---|---|
NUMLOCK | Num Lock key |
SCROLLLOCK | Scroll Lock key |
CAPSLOCK | Caps Lock key |
nKeyState (input)
Specify key status to be checked, which is on or off. You have to set one of the following values.
Value | Description |
---|---|
KEYSTATE_OFF | Specify this value to check whether the key is off. |
KEYSTATE_ON | Specify 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 number | Error code |
---|---|
8 | ERROR_NOT_ENOUGH_MEMORY |
14 | ERROR_OUTOFMEMORY |
87 | ERROR_INVALID_PARAMETER |
112 | ERROR_DISK_FULL |
1400 | ERROR_INVALID_WINDOW_HANDLE |
1460 | ERROR_TIMEOUT |