## Input/Output Device Driver Reference

[prev][next][parent][TOC]

### Overview

The physical keyboard device-dependent driver receives the make-and-break keystroke scan codes along with special keyboard hardware codes. The scan codes are stored until a completed key stroke is received. A key packet is then passed to the device-independent driver which performs one or more of the following operations: (see the following figure):

Translates the scan code to an ASCII character

Recognizes the key as a special key and signals the appropriate routine for processing

Passes the translated scan code's character data record to the monitor dispatcher for further custom processing by monitors

Places the translated scan code's character record into the appropriate session's keyboard input buffer

In addition, the physical keyboard device driver supports code page switching. The following is a result of this support:

Each handle can use one of two system-wide code pages. One code page is current and the other code page can be switched to. Each handle can also use the PC US 437 code page.

The code pages used are defined in CONFIG.SYS with the CODEPAGE and DEVINFO commands.

Using the KEYB command, the language layout of the keyboard can be changed .

Code pages specified with the CODEPAGE command in CONFIG.SYS are for one language only. However, it is possible that code page support for different languages can result if default code pages are not accepted during execution of the KEYB command. This can occur when attempting to load translation tables in a non-supported code page for that language.

The user can control, by the KbdSetCp subsystem function or the CHCP command, which of the two code pages is used in the translation of scan codes.

Two subsystem functions support code page switching:

KbdSetCp - Set to an installed code page, which is loaded if necessary.
KbdGetCp - Get the current in-use code page.

KbdSetCustXt adds a custom code page option.

KbdXlate translates a scan code.

KbdSetCp, KbdGetCp, and KbdXlate can be replaced in the subsystem by the use of the KbdRegister function.

Code page number, Language ID of the translation table, Subcountry ID, language default table indicator, and keyboard type indicator can all be found in the Translation table header of each country's keyboard layout. For more information, refer to "Set Code Page" (Function 50h), which can be found in the OS/2 Physical Device Driver Reference.
[Artwork not shown]

The physical keyboard device driver is the interface between the physical keyboard and applications as shown in the following figure.

(1) is part of the physical device driver interrupt handler.

(2) is part of the physical device driver strategy routine.

(3) is part of the base subsystem/router.