vbdpss.hlp (Table of Contents; Topic list)
Article Q33034, Example 1
                                                 Contents  Index  Back
─────────────────────────────────────────────────────────────────────────────
                           Knowledge Base Contents  Knowledge Base Index
 
 How to Trap CTRL+BREAK on Standard & Enhanced Keyboard - Example 1
 
 Code Example 1
 --------------
 
 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+BREAK on either keyboard (standard
 or extended):
 
 KEY 15, CHR$(&H84) + CHR$(&H46) 'Traps CTRL+BREAK on enhanced keyboard.
 KEY 16, CHR$(&H4) + CHR$(&H46)  'Traps CTRL+BREAK on standard keyboard.
 KEY(15) ON
 KEY(16) ON
 ON KEY(16) GOSUB trap
 ON KEY(15) GOSUB trap
 FOR i = 1 TO 500
    PRINT i
 NEXT
 END
 trap:
    PRINT "trapped"
    RETURN