Skip to content

Commit 0a9cbea

Browse files
committed
Clarify KEY() function, adds an example usage.
Fixes issue #13.
1 parent 9ba5343 commit 0a9cbea

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

manual.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -642,11 +642,22 @@ graphics.
642642
pressed, or a keycode. The
643643
returned value only goes to 0
644644
after reading the key in the
645-
OS (via a `GET` or `POKE
646-
764,0` statement). _Hint:
647-
The value returned is
645+
OS (via a `GET` or `POKE 764,
646+
255` statement).
647+
_Hint: The value returned is
648648
actually the same as_
649649
`(PEEK(764) EXOR 255)`.
650+
The following program will
651+
show the `KEY()` codes for
652+
pressed keys:
653+
654+
PRINT "Press keys, exit with ESC"
655+
REPEAT
656+
REPEAT : UNTIL KEY()
657+
PRINT "Key code: "; KEY()
658+
GET K
659+
PRINT "ATASCI code: "; K
660+
UNTIL K=27
650661

651662

652663
Floating Point Functions

0 commit comments

Comments
 (0)