Keyboard scan codes

Since version 3.1.13, keyboard scan codes are available as predefined constants for some targets. All you need to do is INCLUDE the keyboard definition for the platform you're targeting. For example:

INCLUDE "keycodes_c64.bas" ' For the Commodore-64
PRINT "press f1"
DO UNTIL KEY(KEY_F1) <> 0 
LOOP

Click on each link to see what constants the library files define.

Platform Library file to include
Commodore-64 keycodes_c64.bas
Commodore-128 keycodes_c128.bas
Commodore-16 and Plus/4 keycodes_c264.bas
Commodore VIC-20 keycodes_vic20.bas
Commodore PET (business, UK) keycodes_pet_business_uk.bas
Commodore PET (business, US) keycodes_pet_business_us.bas
Commodore PET (graphics) keycodes_pet_graphics.bas