Commodore 128 Function Keys Guide and Commands
The Commodore 128 features a robust set of function keys designed to streamline programming and system navigation. This article explores the default assignments of the F1 through F8 keys, explains how they operate in both native C128 and Commodore 64 modes, and provides instructions on how users can customize these keys to execute specific BASIC commands or strings for enhanced productivity.
Physical Layout and Modes
The Commodore 128 keyboard includes eight function keys located on
the far right side, labeled F1 through F8. These keys are sensitive to
the current operating mode of the computer. When the machine is booted
in native C128 mode, the keys function according to the C128 BASIC
interpreter definitions. However, if the system is switched to Commodore
64 mode, either via the boot menu or the GO 64 command, the
function keys emulate the behavior of the Commodore 64, ensuring
compatibility with software designed for the earlier platform.
Default Assignments in C128 Mode
In the native C128 environment, the function keys are pre-programmed to assist with common BASIC operations. While specific definitions can vary slightly depending on the ROM version, the standard configuration typically maps the unshifted keys to frequent commands. For example, F1 is often assigned to the LIST command, while F2 is commonly set to RUN. This allows users to quickly manage program execution without typing full commands. The shifted versions of these keys (holding Shift while pressing F1-F8) usually provide secondary commands or variations, such as loading from specific device numbers or displaying directory information.
Customizing Keys with the KEY Command
One of the most powerful features of the Commodore 128 is the ability
to reprogram these keys using the BASIC KEY command. Users
can assign any string of characters, BASIC commands, or control
sequences to any of the eight function keys. The syntax generally
follows the format KEY n, "string", where n
represents the function key number from 1 to 8. For instance, typing
KEY 1, "PRINT CHR$(147)" would program the F1 key to clear
the screen when pressed. This customization persists until the computer
is reset or the key is reprogrammed, allowing users to create shortcuts
for complex routines or frequently used code snippets.
Functionality in Commodore 64 Mode
When operating in Commodore 64 mode, the function keys adhere to the limitations and definitions of the C64 architecture. In this mode, the keys are often used to insert BASIC keywords or special characters to speed up programming. Typically, the odd-numbered keys (F1, F3, F5, F7) insert commands, while the even-numbered keys (F2, F4, F6, F8) insert commands when shifted, or they may be assigned to color codes. Understanding this distinction is vital for users who switch between modes frequently, as a key programmed in C128 mode will not retain its custom definition when the system is switched to C64 compatibility.
Troubleshooting and Resetting
Occasionally, users may find that their function keys are not behaving as expected, often due to previous customizations that have not been cleared. To restore the default function key definitions in C128 mode, a simple reset of the machine is usually required. There is no direct BASIC command to restore factory defaults for the keys without reloading the kernel vector tables, so power cycling the computer remains the most reliable method to return the F1 through F8 keys to their original state. Ensuring the keys are reset is a good first step when troubleshooting unexpected behavior during programming sessions.