1.5 Hardware Functions

Hardware functions alter the state of input devices and obtain state information. Windows uses the mouse and the keyboard as input devices. Following are hardware functions:

Function Description

EnableHardwareInput Enables or disables mouse and keyboard input throughout the application.
GetAsyncKeyState Returns interrupt-level information about the key state.
GetInputState Returns nonzero if there is mouse or keyboard input.
GetKBCodePage Determines which code-page tables are loaded.
GetKeyboardState Copies an array that contains the state of each key.
GetKeyNameText Retrieves a string specifying the name of a key from a list maintained by the keyboard driver.
GetKeyState Retrieves the state of a virtual key.
MapVirtualKey Accepts a virtual-key code or scan code for a key and returns the corresponding scan code, virtual-key code, or ASCII value.
OemKeyScan Maps the ASCII values of OEM character codes 0 through 0x0FF into the OEM scan codes and shift states. For more information about the OEM character set, see the Microsoft Windows Guide to Programming.
SetKeyboardState Sets the state of one or more keys by altering values in an array.
VkKeyScan Translates a Windows character to the corresponding virtual-key code and shift state for the current keyboard.

For detailed information about the hardware functions, see the Microsoft Windows Programmer's Reference, Volume 2.