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

ID: Q94836


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for MS-DOS, version 1.0


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

  1. Start VBDOS.EXE.


  2. From the File menu, choose New Form... (FORM1.FRM). Form1 is created by default.


  3. Exit the Form Designer, and save all changes.


  4. Add the following code to the Form_KeyDown event procedure of Form1:
    
          Sub Form_KeyDown (KeyCode AS INTEGER, Shift As Integer)
             Print "IN KEYDOWN "; KeyCode
          End Sub 


  5. Add the following code to the Form_KeyPress event procedure of Form1:
    
          Sub Form_KeyPress (KeyAscii As Integer)
             Print "IN KEYPRESS ";KeyAscii
          End Sub 


  6. Add the following code to the Form_KeyUp event procedure of Form1:
    
          Sub Form_KeyUp (KeyCode As Integer, Shift As Integer)
             Print "IN KEYUP "; KeyCode
          End Sub 


  7. Press the F5 key to Run the application.


  8. Press the CTRL+DELETE keys; then press the CTRL+BACKSPACE keys. Notice that the numbers returned are exactly the same.


Additional query words: VBmsdos buglist1.00 1.00

Keywords :
Version : MS-DOS:1.0
Platform : MS-DOS
Issue type :


Last Reviewed: December 9, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.