Article ID: 33034 - View products that this article applies to.
This article was previously published under Q33034
The scan code for the BREAK key is &H46. The CTRL+BREAK keystroke combination is trapped differently, depending on whether or not the program is run on a standard or enhanced keyboard.
This information is also included with the Help file provided with the Standard and Professional Editions of Microsoft Visual Basic for MS-DOS, version 1.0.
For a standard keyboard, CTRL+BREAK is defined as follows
where n is in the range 15 through 25.
On an enhanced keyboard, CTRL+BREAK is defined as follows:
Please note that you must make separate user-defined KEY statements for trapping CTRL+BREAK in combination with the SHIFT, ALT, NUM LOCK, and CAPS LOCK keys. The keyboard flags for these other keystroke combinations must be added together to define a given keystroke sequence.
Examples of trapping CTRL+BREAK and CTRL+C (when the SHIFT, ALT, NUM LOCK, or CAPS LOCK keys are NOT active) are included below.
Use the following steps to execute the examples listed below in VBDOS.EXE:
Code Example 1
NOTE: If NUM LOCK, SCROLL LOCK, or CAPS LOCK is on, this example will not work. For additional information on how to disable these keys, please see the following article(s) in the Microsoft Knowledge Base:
(https://support.microsoft.com/kb/59132/EN-US/ )How to Disable Toggle for NUM/CAPS/SCROLL LOCK with Key Trap
Article ID: 33034 - Last Review: August 16, 2005 - Revision: 2.1
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.