[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
KEY(n) Enable/Disable Key Trapping
KEY(n) {ON | OFF | STOP}
Enables or disables the trapping of a specified key via ON KEY(n).
n A numeric expression in the range 1 to 31, specifying the
key to trap, as follows:
1-10,30,31 Function keys F1 through F10, F11, F12
11 Cursor Up
12 Cursor Left
13 Cursor Right
14 Cursor Down
15-25 Keys defined via KEY n, CHR$(KBflag) +
CHR$(scancode)
ON KEY(n) ON activates trapping. If an ON KEY(n) GOSUB
statement has been executed, Turbo Basic checks before
executing each statement to see if the specified key has
been pressed. If it has, Turbo Basic performs the
indicated GOSUB.
OFF KEY(n) OFF deactivates trapping.
STOP KEY(n) STOP also deactivates trapping, but Turbo Basic
continues checking to see if the specified key has been
pressed. If it has been pressed, a subsequent KEY(n) ON
results in an immediate trap (provided an ON KEY(n)
statement with a nonzero line number has been executed).
--------------------------------------------------------------------------
Notes: With event trapping in effect, Turbo Basic checks for the
specified event after each program statement. The $EVENT
metastatement can be used to turn event trapping on and
off at specified points within a program.
See Also:
$EVENT
KEY
ON KEY
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson