Microsoft KB Archive/94836

= Cannot Distinguish CTRL+DEL and CTRL+BACKSPACE In Key Events =

PSS ID Number: 94836

Article Last Modified on 1/8/2003

-

The information in this article applies to:


 * Microsoft Visual Basic for MS-DOS 1.0

-



This article was previously published under Q94836



SYMPTOMS
There is no way to tell the difference between a CTRL+BACKSPACE key press and a CTRL+DEL key press in the KeyDown, KeyUp, or KeyPress events in Visual Basic for MS-DOS. In Visual Basic for Windows, however, these key presses are easily distinguished.



STATUS
Microsoft has confirmed this to be a bug in both the Standard and Professional Editions of Microsoft Visual Basic version 1.0 for MS-DOS. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
In Visual Basic for MS-DOS, the key codes returned when you press CTRL+BACKSPACE and CTRL+DEL are exactly the same. The value returned is 127 in the KeyDown, KeyUp, and KeyPress events. In Microsoft Visual Basic for Windows, CTRL+BACKSPACE returns 8 in the KeyDown and KeyUp events while CTRL+DEL returns 46 in the KeyDown and KeyUp events.

Steps to Reproduce Problem
 Start VBDOS.EXE. From the File menu, choose New Form... (FORM1.FRM). Form1 is created by default. Exit the Form Designer, and save all changes.  Add the following code to the Form_KeyDown event procedure of Form1: Sub Form_KeyDown (KeyCode AS INTEGER, Shift As Integer) Print &quot;IN KEYDOWN &quot;; KeyCode End Sub   Add the following code to the Form_KeyPress event procedure of Form1: Sub Form_KeyPress (KeyAscii As Integer) Print &quot;IN KEYPRESS &quot;;KeyAscii End Sub   Add the following code to the Form_KeyUp event procedure of Form1: Sub Form_KeyUp (KeyCode As Integer, Shift As Integer) Print &quot;IN KEYUP &quot;; KeyCode End Sub </li> Press the F5 key to Run the application.</li> Press the CTRL+DELETE keys; then press the CTRL+BACKSPACE keys. Notice that the numbers returned are exactly the same.</li></ol>

Additional query words: VBmsdos buglist1.00 1.00

Keywords: KB94836

Technology: kbAudDeveloper kbVB100DOS kbVBSearch kbZNotKeyword3

-

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

© 2004 Microsoft Corporation. All rights reserved.