6.1.1 Initializing the Driver

Windows initializes the keyboard driver by calling the driver's initialization routine when it first loads the driver. Windows also calls the driver's Inquire function to retrieve information about the driver in the KBINFO structure.

The initialization routine typically retrieves the computer-type identifier from ROM BIOS and determines whether the Windows is running with MS-DOS or another environment, such as the MS-DOS compatibility box with IBM OS/2. The driver uses the computer-type identifier to determine which translation tables to use when translating scan codes. The driver adapts its processing of keystrokes. For example, if running with OS/2, it passes CTRL+ESC key combinations to OS/2 rather than Windows.

The Inquire function fills the KBINFO structure. The function also specifies the size of the state array Windows must support. Windows calls the ToAscii function to translate scan codes to ANSI character codes.

For more information about your keyboard and ROM BIOS, see the documentation from your computer manufacturer.