Function Key

From C64-Wiki
Jump to navigationJump to search
The C64 function keys

A function key is a part of the keyboard. It is abbreviated with F key. The C64 has 8 function keys F1  to F8 , which are integrated on 4 keys. On other computer systems there are more than 8 function keys, e.g. on a PC there are 12 function keys.

On the C64/128 and VIC-20 the uneven numbered function keys are reached directly and the even numbered function keys are activated by additionally pressing the key SHIFT .

The function keys can only be used in programs. In BASIC programs the commands GET or PEEK are used for acessing the function keys.

The C16/116 and Plus/4 have a different function key combination. The keys F1  to F3  and HELP  are directly pushed. For the keys F4  to F7  they same keys must be combined with the key SHIFT . This function keys are mapped by the OS.

Function keys are used for controlling a program or calling up often used routines, e.g. listing the directory of a floppy disk or making a hardcopy of the screen.

Function keys can also be mapped by the user. On C128, C16/116 and Plus/4 this is easily done with the BASIC command KEY. Also cartridges and BASIC expansions use the function keys for calling up routines or commands for better user comfort. Some of them expand them to up to 16 function keys. These expanded function keys (F9  or higher) are often available in combination with the keys C=  or CTRL .

Programming[edit | edit source]

A short BASIC program for using the function keys:

10 B$ = "YOU PUSH: "
20 GET A$: IF A$="" THEN 20
30 IF A$=CHR$(133) THEN PRINT B$"F1"
31 IF A$=CHR$(134) THEN PRINT B$"F3"
32 IF A$=CHR$(135) THEN PRINT B$"F5"
33 IF A$=CHR$(136) THEN PRINT B$"F7"
34 IF A$=CHR$(137) THEN PRINT B$"F2"
35 IF A$=CHR$(138) THEN PRINT B$"F4"
36 IF A$=CHR$(139) THEN PRINT B$"F6"
37 IF A$=CHR$(140) THEN PRINT B$"F8"
38 IF A$="X" THEN END
40 GOTO 20

The program is aborted by pushing the key X .