Microsoft KB Archive/196900

{|
 * width="100%"|

PRB: Getch returns wrong keyboard values when CAPSLOCK is on.

 * }

Q196900

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK), on platform(s):
 * the operating system: Microsoft Windows 95
 * the operating system: Microsoft Windows 98

-

SYMPTOMS
If the CAPSLOCK key is turned on and if non-alphabetic keys (such as 1,2,3,;,[, and so on) are pressed, getch returns !,@,#,:,{,... In other words, it acts as if the SHIFT key is being pressed. This applies to all the numeric and punctuation keys. This problem occurs in Windows 95 and Windows 98.

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

Steps to Reproduce Behavior
Create a simple console application, with the following code snippet:

  char c;     ...

c = getch; printf( "%c \n",c );

... RESULTS: If the CAPS LOCK is turned on and if you press the non-alphabetic keys (1,2,3,;,[, and so on), getch returns !,@,#,:,{... in Windows 95 and Windows 98.

This problem does not occur in Windows NT.

Additional query words:

Keywords : kbKeyIn kbSDKPlatform kbOSWin95 kbOSWin98

Issue type : kbprb

Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWin32sSearch