KEYROW
is
a function which looks at the instantaneous state of a row of keys (the table
below shows how
the
keys
are mapped onto a matrix
of
8
rows
by 8 columns). KEYROW
takes one parameter, which must be an Integer
in
the range a
to
7:
this number selects
which row
IS
to
be looked
at.
The value returned by KEYROW
is
an Integer between
a and 255 which gives a binary representation indicating which
keys
have been
depressed
in
the selected row
Since KEYROW
is
used
as
an alternative
to
the
normal keyboard Input mechanism using
INKEY$ or INPUT, any character
in
the keyboard type-ahead buffer are cleared by
KEYROW: thus
key
depreSSions which have been made before a call
to
KEYROW
will
not be read
by
a subsequent INKEY$ or INPUT.
Note that multiple
key
depressions can cause surprising results.
In
particular,
it
three
keys
at
the corner of a rectangle
in
the matrix are depressed simultaneously,
it
will
appear
as
if
the
key
at
the tourth corner has also been depressed. The three special
keys
CTRL,
SHIFT and
ALT
are
an exception
to
thiS
rule,
and
do
not
interact
with
other
keys
in
thiS
way.
syntax:
row:
= numenc_expresslon Irange a
.71
KEYROW
(row)
KEYROW
KEYBOARD MATRIX
example:
100
REMark
run
this
program
and
press
a
few
keys
110
REPeat
loop
120
CURSOR
0.0
130
FORrow=Oto7
140
PRINT
row
I I I
KEY
ROW
(row)
150
END
FOR
row
160
END
REPeat
loop
•
•
COLUMN
ROW
2
4 8
16
32
64
128
30
7
6
5
4
3
2
o
SHIFT
CTRL
ALT
X V I N
8 2 6
Q.
E 0 T U
9
W I
TAB
R
-
y
L
3
H 1 A P 0 J
I
CAPS
K
S
F G
LOCK
~
I
z
C
B
£
M
-
ENTER
~
up
ESC
~
\
SPACE
down
F4
F1
5
F2
F3 F5
4 7
12/84
•
•