KEYBOARD (System Variable)

is a read-only numerical system variable that gets updated once every frame (sixtieth of a second).

When no key on the Petit Computer virtual keyboard is pressed,  has a value of 0. When a key is pressed, it becomes the corresponding value in the Key Scan Codes list for one frame, then becomes 0 again. If the key remains 'pressed', the corresponding value will appear again 30 frames after the initial detection, then 35, then 40, etc..

The 5 'function keys' at the top of the lower screen, "1 FILE." "2 LOAD." "3 SAVE." "4 CONT" "5 RUN" do not count as 'keys' (the system variable FUNCNO detects these buttons), nor does the "X" at the top-right, the "ESC" 'key', or anything in the green bar at the bottom of the screen.