qck.hlp (Table of Contents; Topic list)
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.
ON KEY Statement
  ◄Summary►  ◄Details►  ◄Example►                ◄Contents►  ◄Index►  ◄Back►
──────────────────────────────────────────────────────────────────────────────
 Branches to a routine when the specified key is pressed; not available when
 forms are showing; cannot be used with object-specific events.
 
    ON KEY(n%) GOSUB {linenumber | linelabel}
 
    ■ n%              Value that specifies a function key, arrow key, or
                      user-defined key:
 
                      Value     Description
                      ══════    ════════════════════════════════════════════
                      0         All keys listed (KEY(0) ON, KEY(0) OFF, and
                                KEY(0) STOP only)
                      1 - 10    Function keys F1 - F10
                      11        Up arrow key
                      12        Left arrow key
                      13        Right arrow key
                      14        Down arrow key
                      15 - 25   User-defined keys
                      30, 31    Function keys F11 and F12
 
    ■ linenumber      First line of an event-handling routine to execute
      linelabel       when a function key, arrow key, or user-defined key
                      is pressed
 
 See Also
    ◄Declaring User-Defined Keys►      ◄Error/Event Trapping Summary►
    ◄KEY Statement (Assignment)►       ◄Keyboard Scan Codes►
    ◄KEY Statement (Event Trapping)►   ◄KeyDown Event►
    ◄KeyPress Event►                   ◄KeyUp Event►