Microsoft KB Archive/304614

= Keyboard Layout May Be Incorrect After Installing USB Keyboard =

Article ID: 304614

Article Last Modified on 1/31/2007

-

APPLIES TO


 * Microsoft Windows Millennium Edition

-



This article was previously published under Q304614



IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry



SYMPTOMS
If you install a Universal Serial Bus (USB) keyboard on a computer that is already equipped with a keyboard with a different layout and then reboot the computer, the keyboard layout may default to the English 101/104 layout. This problem can occur if either of the following conditions applies to the USB keyboard:
 * The USB keyboard provides a Plug and Play ID that is used for multiple keyboard layouts. For example, this applies to some Japanese USB keyboards.
 * The USB keyboard provides a Plug and Play ID that is not listed in the system Keyboard.inf file. This is possible with keyboards that are produced after the release of Windows Millennium Edition (Me). Note that the English 101/104 layout is the default for unknown (unsupported) keyboards.

Note that this information also applies to laptop computers that are equipped with externally attached (PS/2) keyboards.



CAUSE
Windows Me does not support multiple keyboards with different layouts. Prohibitively complex design changes in a number of system components would be necessary to implement additional abstraction of keyboard mapping between multiple keyboards and input processing.

For example, if your laptop keyboard type is Japanese 106 and you plug in a supported USB keyboard with an English 101/104 layout, only one of the keyboards is properly mapped. This occurs because keyboard information is maintained in a single registry key that is set during installation, or by the System Configuration Utility (Msconfig). The values are read into system memory when Windows starts. The default value for unknown (or unsupported) keyboards is English 101/104.



RESOLUTION
After you complete the following steps, the keyboard layout will be correct over successive restarts, even if you unplug the USB keyboard and then plug it back in to the same USB port. Note that if you plug the USB keyboard into a different USB port, you may need to follow the steps again.

Using the System Configuration Utility to Change the Keyboard Layout

 * 1) On the Start menu, click Run.
 * 2) Type msconfig, and then click OK.
 * 3) Click the International tab.
 * 4) In the Language box, click the appropriate language. See the &quot;More Information&quot; section in this article for Japanese 106 sample values.
 * 5) Click OK.
 * 6) When you are prompted to restart your computer, click Yes. If you do not click Yes, the changes do not take effect until you restart your computer.

You can use Msconfig to verify that the Keyboard Type value has not changed. Or, you can use Registry Editor to examine the existing values (see the &quot;More Information&quot; section in this article for details).



STATUS
This behavior is by design.



MORE INFORMATION
WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

Please review the following Microsoft Knowledge Base article before you attempt any operations with the following sample .inf file text:

171424 How to Remove Windows 95/98 Registry Entries Automatically

Microsoft recommends that you follow the steps in the &quot;Resolution&quot; section of this article instead.

For the Japanese 106 keyboard, you can save the following text in an .inf file, right-click the file, and then click Install. The following sample .inf file text is provided as an example only, and should not be used on any non-Japanese Windows Me installation:

[version]

signature = &quot;$CHICAGO$&quot;

AdvancedINF = 2.5, %AdvPackWarn%

[DefaultInstall]

AddReg = Add.Reg.106

DelReg = Del.Reg

[Add.Reg.106]

HKLM,%NlsKey%,DOSCP,,932

HKLM,%NlsKey%,OEMCC,,81

HKLM,%NlsKey%,COUNTRYFNAME,,%11%\country.sys

HKLM,%NlsKey%,KYBFNAME,,jkeybrd.sys

HKLM,%NlsKey%,KYBTYPE,,106

HKLM,%NlsKey%,LANGID,,&quot; &quot;

[Del.Reg]

HKLM,%NlsKey%,CODEPAGEFNAME

HKLM,%NlsKey%,KYBLAYOUT

[Strings]

NlsKey = System\CurrentControlSet\Control\Nls\Codepage

This is a sample equivalent for the Japanese 101 keyboard:

[version]

signature = &quot;$CHICAGO$&quot;

AdvancedINF = 2.5, %AdvPackWarn%

[DefaultInstall]

AddReg = Add.Reg.101

DelReg = Del.Reg

[Add.Reg.101]

HKLM,%NlsKey%,DOSCP,,932

HKLM,%NlsKey%,OEMCC,,81

HKLM,%NlsKey%,COUNTRYFNAME,,%11%\country.sys

HKLM,%NlsKey%,KYBFNAME,,jkeybrd.sys

HKLM,%NlsKey%,KYBTYPE,,101

HKLM,%NlsKey%,LANGID,,&quot; &quot;

[Del.Reg]

HKLM,%NlsKey%,CODEPAGEFNAME

HKLM,%NlsKey%,KYBLAYOUT

[Strings]

NlsKey = System\CurrentControlSet\Control\Nls\Codepage

Sample Registry Settings
Registry key:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Nls\Codepage

Values:

                        Registry Control label           value name      Sample [Japanese 106] -- MS-DOS Code Page:       DOSCP           &quot;932&quot; Country Code:           OEMCC           &quot;81&quot; Country Data File Name: COUNTRYFNAME    &quot;C:\Windows\COMMAND\country.sys&quot; Display Data File Name: CODEPAGEFNAME   (not present) Keyboard Data File Name: KYBFNAME       &quot;C:\Windows\COMMAND\jkeybrd.sys&quot; Keyboard Type:          KYBTYPE         &quot;106&quot; Keyboard Layout:        KYBLAYOUT       (not present) Language ID:            LANGID          &quot;  &quot;

The following values that are also contained in the preceding registry key are returned by the indicated National Language Support (NLS) functions. They are only read from the registry during system initialization, and should not be changed:

Registry   Sample  NLS API     Value value name value   function    meaning

ACP        &quot;932&quot;   GetACP    Japanese OEMCP      &quot;932&quot;   GetOEMCP  Japan

The system ANSI code page (ACP) is used as a lookup value in Msconfig to build the list of available languages. The system Original Equipment Manufacturer code page (OEMCP) registry value is not used on the Msconfig International tab. The values shown in the preceding table are the default values that are used if the registry values cannot be read.

