PRB: getch() Does Not Behave as Expected with ALT+Q and ALT+R

Last reviewed: July 17, 1997
Article ID: Q41203
5.10 6.00 6.00a 6.00ax 7.00 | 1.00 1.50
MS-DOS                      | WINDOWS
kbprg kbprb

The information in this article applies to:

  • The C Run-time (CRT), included with:

        - Microsoft C for MS-DOS, versions 5.1, 6.0, 6.0a, and 6.0ax
        - Microsoft C/C++ for MS-DOS, version 7.0
        - Microsoft Visual C++ for Windows, versiona 1.0 and 1.5
    

SYMPTOMS

The program accepts all keyboard inputs, but does not behave as expected if the input is ALT+Q or ALT+R.

CAUSE

This is not a problem with the Microsoft C Optimizing Compiler run-time function getch(). The problem is caused because MS-DOS uses these two key combinations for other control purposes.

MORE INFORMATION

In this case, the second scancode of ALT+Q is 16 and the second scancode of ALT+R is 19 (both decimal). MS-DOS uses scancode 16 to mean "echo subsequent output to the printer" and scancode 19 to mean "pause output." These are equivalent to CTRL+P and CTRL+S. When a printer is not connected to the computer, the PRINT SCREEN key must wait for time-out. For the SCREEN PAUSE key, another key must be pressed to activate the screen again.


Additional reference words: 5.10 6.00 6.00a 6.00ax 7.00 1.00 1.50
KBCategory: kbprg kbprb
KBSubcategory: CRTIss
Keywords : kb16bitonly


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 17, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.