Table of Contents

KEY

PET VIC-20 C64 C16 Plus/4 C128

The KEY() function tests whether a specified key is being depressed on the keyboard.

Function declaration

DECLARE FUNCTION _
KEY AS BYTE (scancode AS WORD) SHARED STATIC INLINE

For the list of scan codes on particular platforms, see Keyboard scancodes.

Example

CONST Q = 32576 ' scan code for Q key
PRINT "press Q key to quit program"
DO : LOOP UNTIL KEY(Q)
PRINT "good bye"
END