AIT_SetKeyState

Description

Sets specified key status.

Format

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

Parameters

nVirtualKey (input)

Specify a virtual key you want to set. You have to set one of the following values.

ValueDescription
NUMLOCKNum Lock key
SCROLLLOCKScroll Lock key
CAPSLOCKCaps Lock key

nKeyState (input)

Specify key status you want to set. You have to set one of the following values.

ValueDescription
KEYSTATE_OFFThe key is off.
KEYSTATE_ONThe key is on.

Return values

The return value is true if the function was executed normally, and false if not. If the function has returned false, 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