Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Article Q33034
◄Contents► ◄Index► ◄Back►
─────────────────────────────────────────────────────────────────────────────
◄Knowledge Base Contents► ◄Knowledge Base Index►
How to Trap CTRL+BREAK, CTRL+C on Standard & Enhanced Keyboard - 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.
For a standard keyboard, CTRL+BREAK is defined as follows:
KEY n, CHR$(&H04) + CHR$(&H46)
where n is in the range 15 through 25.
On an enhanced keyboard, CTRL+BREAK is defined as follows:
KEY n, CHR$(&H84) + CHR$(&H46)
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.
See the following examples for:
◄Trapping CTRL+BREAK►
◄Trapping CTRL+C►
(when the SHIFT, ALT, NUM LOCK, or CAPS LOCK keys are NOT active).