SetKeyboardState

  BOOL SetKeyboardState(lpbKeyState)    
  LPBYTE lpbKeyState; /* address of array with virtual-key codes */

The SetKeyboardState function copies a 256-byte array of keyboard key states into the Windows keyboard-state table.

Parameters

lpbKeyState

Points to an array of 256 bytes that contains keyboard key states.

Return Value

The return value is TRUE if the function was successful, or FALSE if an error occurs. Use the GetLastError function to obtain extended error information.

Comments

SetKeyboardState sets the LEDs and BIOS flags for the NUMLOCK, CAPSLOCK, and SCROLL LOCK keys according to the toggle state of the VK_NUMLOCK, VK_CAPITAL, and VK_OEM_SCROLL entries of the array.

See Also

GetKeyboardState, GetKeyState, GetAsyncKeyState