Chapter
10
I
BASIC
Keywords
KEY/Trap
Statement
KEY(number)
action
Turns on, turns
off,
or
temporarily halts key trapping for a spec-
ified key.
Action may be any
of
the following:
ON
enables key trapping
OFF disables key trapping
STOP temporarily suspends key trapping
Number may be a number in the range
1
to
20, indicating the
number of the key to trap. Function keys use their corresponding
function key number (1-10). The cursor direction key trap num-
bers are:
11
12
13
14
User-defined keys are 15-20. Use the following syntax
to
define
your own user keys:
KEY
number, CHR$(key)
+
CHR$(scan)
Key is one
of
or a combination
of
the following:
&H40
[CAPSJ
lock key
&H20
(NUMLOCK]
key
&H08
(ALT)
key
&H04
[CTRLJ
key
&H02 Left key
&H01 Right key
Scan is the scan code for
a
physical key on the keyboard.
See the appendices for a list of scan codes.
Notes:
Trapped keys do not go into the keyboard buffer.
0
Defining
a
function key
or
a cursor-direction key has no
effect.
BASIC
considers them pre-defined.
192