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

You can include keyboard device layouts in an OS design or dynamically load them at run time.

Including Keyboard Device Layouts in an OS Design

You can include multiple device layouts in an OS design. By default, all device layouts are compiled into the keyboard driver DLL. Compiling all device layouts into the keyboard driver DLL minimizes the number of DLLs in the run-time image. Layout Manager identifies device layouts by their entry points. Device layout entry points are generated from the registry. Use the appropriate input locale identifier for your keyboard layout. For more information about input locals and their associated keyboard layouts, see Translating Scan Codes to Virtual-Key Codes.

The value name and the locale identifier comprise the device layout entry points. If one decorated entry does not exist, Layout Manager attempts to use the undecorated names. For example, if Kbdmouse.dll exposes Matrix_00000409, which is a decorated entry point, Layout Manager attempts to use Matrix, which is the undecorated name. This is useful when the device layout does not need to be localized so the same scan code to virtual-key code mappings and remapping functions can be used for every language.

The following registry keys show the PS2_AT_00000409, Matrix_00000409and PS2_AT_00010409device layout entries into Kbdmouse.dll. The input locale registry subkey allows Layout Manager to determine the locales that are available.

Copy Code
	"Layout File"="kbdmouse.dll"
	"Layout Text"="US"
	"Layout Display Name"=mui_sz:"Mykeyboard.dll, # 22

	"Layout File"="kbdmouse.dll"
	"Layout Text"="United States-Dvorak"

Layout Manager uses the value of Layout Fileto determine which DLL contains the input language. The DLL listed for Layout Filedoes not need to match the DLLs listed for the device layout entry points. For more information, see Input Languages.

The following table shows the two types of Preloadregistry keys.

Registry key example Description
Copy Code
[HKEY_CURRENT_USER\Keyboard Layout\Preload]
  @="<HKL value>"

The Preloadregistry subkey without a Preloadsubkey value is the default input locale.

Copy Code
[HKEY_CURRENT_USER\Keyboard Layout\Preload\
<Preload value>]
  @="<HKL value>"

The Preloadregistry subkey values between 1 and 15 represent the available input locales. You can use up to 15 different keyboard layouts, and the Preloadregistry subkey values do not have to be in order.

LOC_HKL_DEFAULT in the Common.str file specifies the default Preloadvalue. If you change the default keyboard layout after the first boot, you must soft reset the platform for the changes to take affect. For more information when using Windows Embedded CE 6.0, see Multiple Input Language Support.

If there is no input locale available at boot time, some components of the OS will not function correctly until an input locale is loaded. This affects Remote Desktop Protocol (RDP) keyboards, human interface device (HID) keyboards, and software-based input panels (SIPs).

The following example registry keys show the HKEY_CURRENT_USER\Keyboard Layout\Preloadregistry subkeys. These registry keys show two input locales, 00000409 and 00010409. 00000409 is the default input locale.

Copy Code
[HKEY_CURRENT_USER\Keyboard Layout\Preload]

[HKEY_CURRENT_USER\Keyboard Layout\Preload\1]

[HKEY_CURRENT_USER\Keyboard Layout\Preload\2]
An error occurs if you ask Layout Manager to switch to an input locale that does not exist in the Preloadregistry subkey.

Adding Keyboard Device Layouts at Run Time

You can install a device layout at run time. When you install the DLL on the device, add the DLL's entries to the registry in the same manner as the layouts included in the build described previously.

You can replace any device layout at run time by changing the name of the DLL in the registry. Each time Layout Manager changes device layouts, it checks the registry for the DLL that contains the entry function.

The following registry key shows the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Layouts\00000407registry key.

Copy Code
	"Layout File"="KbdGer.dll"
	"Layout Text"="German"

See Also


Device Layouts