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, Example 2
◄Contents► ◄Index► ◄Back►
─────────────────────────────────────────────────────────────────────────────
◄Knowledge Base Contents► ◄Knowledge Base Index►
How to Trap CTRL+C on Standard & Enhanced Keyboard, Example 2
Code Example 2
--------------
Use the following steps to execute the examples listed below in
VBDOS.EXE:
1. From the File menu, choose New Project.
2. Copy the code example to the Code window.
3. Press F5 to run the program.
Use the following code to trap a CTRL+C on either keyboard (standard
or extended):
KEY 18, CHR$(&H4)+CHR$(&H2E) ' The &H4 is the CTRL Key.
KEY (18) ON ' The &H2E is the C key.
ON KEY(18) GOSUB ctrlctrap
10 : GOTO 10
END
ctrlctrap:
PRINT "CONTROL+C Trapped"
RETURN