Microsoft KB Archive/63781

= INKEY$ Fails with Various CTRL, ALT Key Combinations QB 4.00 =

Article ID: 63781

Article Last Modified on 11/21/2006



This article was previously published under Q63781



SYMPTOMS
The INKEY$ statement fails to return any value with certain CTRL and ALT key combinations that should return extended (2-byte) codes. The table below lists the keys that fail to return values:   CTRL+                         ALT+ -

TAB                          ` (back apostrophe) INS (INSert)                 BACKSPACE DEL (DELete)                 TAB Keypad 5                     [ and ] Keypad /                     ; and &quot; Keypad *                    , and. and / Keypad -                     ENTER Keypad +                     Keypad / * - and +



STATUS
Microsoft has confirmed this problem with Microsoft QuickBasic versions 4.00, 4.00b, and 4.50, and Microsoft Basic Compiler versions 6.00 and 6.00b for MS-DOS and OS/2 (buglist6.00, buglist6.00b). The problem does not occur with earlier versions of Microsoft Basics. This problem was corrected in Microsoft Basic Professional Development System (PDS) version 7.00 (fixlist7.00).



MORE INFORMATION
Function keys, editing keys, and most CTRL and ALT key combinations should be returned from INKEY$ as a two-character code where the first character is a null character (CHR$(0)) and the second character identifies the key pressed.

Code Example
The following code example demonstrates how to examine key codes for any type of key: WHILE i$ <> CHR$(27)  'Exit with ESC (ESCape) key i$ = INKEY$ SELECT CASE LEN(i$) 'Type of key depends on length CASE 1: PRINT &quot;Single character:&quot;, ASC(i$), i$        CASE 2: PRINT &quot;Double character:&quot;, ASC(RIGHT$(i$,1)) CASE ELSE REM no key pressed END SELECT WEND END

Additional query words: QuickBas BasicCom buglist4.00 buglist4.00b buglist4.50 B_BasicCom SR# S900706-85

Keywords: KB63781

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.