Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
Windows Mobile Supported Windows Embedded CE Supported
4/14/2010

The sample HID keyboard driver, kbdhid, requires certain support from the built-in GWES keyboard driver.

The following table shows the support required.

Support requirement Description

PFN_KEYBD_DRIVER_MAP_VIRTUAL_KEY (uCode, 3)must remap the AT scan codes to virtual keys.

The HID keyboard driver converts HID key identifiers to AT scan codes. These scan codes are converted to virtual keys through a call to MapVirtualKey (<scan code>, 3)that resolves to the built-in keyboard driver's PFN_KEYBD_DRIVER_MAP_VIRTUAL_KEYfunction. The built-in keyboard driver is responsible for this conversion because it already contains the localized keyboard tables for scan code to virtual-key, virtual-key to scan code, and virtual-key to Unicode character conversions. Thus, the HID keyboard does not need to be localized because it relies on the localized tables in the built-in keyboard driver.

If your built-in keyboard driver conforms to the Layout Manager PDD model and uses AT scan codes natively, this support requirement is already satisfied. If your built-in keyboard driver conforms to Layout Manager PDD model, but does not use AT scan codes, then the stub PDD should be included in the driver to meet this support requirement. It should also be added as the first entry of Layout Manager's PDD list so that its tables are used for MapVirtualKey.

Additionally, the AT device layouts for the supported locales must be included in the run-time image either in their own DLLs or built into the keyboard driver. The proper registry entries must be added to enable these device layouts. The AT device layouts are compiled into files named PS2_AT_ <input locale>.lib.

If you are using a keyboard driver from Windows CE .NET 4.1 or earlier, the AT scan code to virtual-key tables must be added to the driver and used when MapVirtualKeyis called with 3 as the conversion code. The AT scan code tables can be taken from %_WINCEROOT%\public\common\oak\drivers\keybd\devicelayouts\ps2_at\<input locale>\PS2_AT_<input locale>.cpp. The tables differ across input locales, so the proper tables to use are the ones that conform to the desired input locale for the target keyboard.

PFN_KEYBD_DRIVER_INITIALIZEand PFN_KEYBD_DRIVER_INITIALIZE_EXmust spawn a thread that sends the current global modifier state of CAPS LOCK, NUM LOCK, and SCROLL LOCK to the HID keyboard driver as new keyboards are attached.

If your built-in keyboard driver conforms to the Layout Manager PDD model, this support requirement is already satisfied.

PFN_KEYBD_DRIVER_VKEY_TO_UNICODEmust send the global modifier state to all HID keyboard driver instances named KBDn: when that state changes.

If your built-in keyboard driver conforms to the Layout Manager PDD model, this support requirement is already satisfied.

Optional. The thread spawned by PFN_KEYBD_DRIVER_INITIALIZEand PFN_KEYBD_DRIVER_INITIALIZE_EXmight send the current auto-repeat timings in addition to the global keyboard state.

If your built-in keyboard driver conforms to the Layout Manager PDD model, this support option is satisfied. To add the optional support to old-style drivers, see the BroadcastAutoRepeatInfo, SendAutoRepeatInfo, and KbdNotificationThreadfunctions in %_WINCEROOT%\public\common\oak\drivers\keybd\laymgr\laymgr.cpp.

Optional. PFN_KEYBD_DRIVER_SET_MODE (iPddId, KBDI_AUTOREPEAT_INFO_ID, lpInput)might send the new auto-repeat timings to all HID keyboard driver instances.

If your built-in keyboard driver conforms to Layout Manager PDD model, this support option is satisfied. To add the optional support to old-style drivers, see the BroadcastAutoRepeatInfoand SendAutoRepeatInfofunctions in %_WINCEROOT%\public\common\oak\drivers\keybd\laymgr\laymgr.cpp.

See Also

Concepts

Layout Manager

Other Resources

Keyboard Drivers