Device Layout Data (Windows CE 5.0)
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_00000409 and PS2_AT_00010409 device layout entries into Kbdmouse.dll. The input locale registry subkey allows Layout Manager to determine the locales that are available.
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Layouts\00000409]
"Layout File"="kbdmouse.dll"
"Layout Text"="US"
"PS2_AT"="kbdmouse.dll"
"Matrix"="kbdmouse.dll"
"Layout Display Name"=mui_sz:"Mykeyboard.dll, # 22
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Layouts\00010409]
"Layout File"="kbdmouse.dll"
"Layout Text"="United States-Dvorak"
"PS2_AT"="kbdmouse.dll"
Layout Manager uses the value of Layout File to determine which DLL contains the input language. The DLL listed for Layout File does 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 Preload registry keys.
Registry key example | Description |
---|---|
|
The Preload registry subkey without a Preload subkey value is the default input locale. |
|
The Preload registry subkey values between 1 and 15 represent the available input locales. You can use up to 15 different keyboard layouts, and the Preload registry subkey values do not have to be in order. |
Note LOC_HKL_DEFAULT in the Common.str file specifies the default Preload value. 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, 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\Preload registry subkeys. These registry keys show two input locales, 00000409 and 00010409. 00000409 is the default input locale.
[HKEY_CURRENT_USER\Keyboard Layout\Preload]
@="00000409"
[HKEY_CURRENT_USER\Keyboard Layout\Preload\1]
@="00000409"
[HKEY_CURRENT_USER\Keyboard Layout\Preload\2]
@="00010409"
Note An error occurs if you ask Layout Manager to switch to an input locale that does not exist in the Preload registry 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\00000407 registry key.
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Layouts\00000407]
"Layout File"="KbdGer.dll"
"Layout Text"="German"
"PS2_AT"="KbdGer.dll"
See Also
Send Feedback on this topic to the authors