command/KEY command/KEY
NAME
KEY -- Assigns a string into a function key
ABBREVIATION
k <shift> E
SYNOPSIS
KEY [<key>,<string>]
FUNCTION
There are eight (8) function keys available to the user on your
Commodore 16 computer: four unshifted and four shifted. Your Commodore
16 allows you to define what each key does when pressed. KEY without any
parameter specified gives a listing displaying all the current KEY
assignments. The data you assign to a key is typed out when that
function key is pressed. The maximum length for all the definitions
together is 128 characters. Entire commands (or a series of commands)
can be assigned to a key.
INPUTS
<key> - function key number (1-8)
<string> - string to be assigned into a key
RESULT
Shows current function key bindings or assigns a string into a function
key.
EXAMPLES
KEY 7,"GRAPHICS0"+CHR$(13)+"LIST"+CHR$(13)
Causes the computer to select text mode and list your program
whenever the "F7" key is pressed (in direct mode). The CHR$(13) is
the ASCII character for <return>.
NOTES
Use CHR$(34) to incorporate a double quote into a KEY string.
The keys may be redefined in a program. For Example:
10 KEY2,"TESTING"+CHR$(34):KEY3,"NO"
To define function keys as they are on the Commodore 64 and VIC 20:
10 FOR I=1 TO 8:KEY I,CHR$(I+132):NEXT
To restore all function keys to their default values, reset your
Commodore 16 by turning it off and on, or press the RESET button.
BUGS
None
SEE ALSO
None