If you want your keyboard layout loaded each time the user boots their system, you will need to enumerate the registry at: HKEY_CURRENT_USER, "keyboard layout\preload\#" to find the next available # and then make the following entry:
HKEY_CURRENT_USER,"keyboard layout\preload\#",,<language identifier>
Using our preceding example:
HKEY_CURRENT_USER,"keyboard layout\preload\2",,00010816
If you want to immediately load your keyboard layout for the user you need to use the Win32® LoadKeyboardLayout function.
This cannot be done using an INF file, so you will have to develop an installation program that uses the Win32 functions to copy files and add a key to the registry.
The installation program needs to add to the Registry location HKLM,"system\currentcontrolset\control\keyboard layouts\<language identifier>" the string keys Layout File and Layout Text. Also, if the <language identifier> does not have 0000 in the high word, you will need the to add the layout ID key. The Layout File value should be the filename of the keyboard layout file and Layout Text should be a description of the keyboard layout that can be displayed in the Windows 95 user interface. Using the Portuguese (Macao) example, after your installation program runs the following values and keys should be added to the registry (assuming the name of your keyboard layout file is KBDPM.KBD:
HKLM,"system\currentcontrolset\control
\keyboard layouts\00010816","layout file",,kbdpm.kbd
HKLM,"system\currentcontrolset\control
\keyboard layouts\00010816","layout text",,"Portuguese (Macao)"
HKLM,"system\currentcontrolset\control
\keyboard layouts\00010816","layout id",,013