KEY
This page was last modified 10:06, 9 December 2016 by Mars2000you. Based on work by Rderooy and Gdx.

Contents

Effect

  • Lists the contents of the function keys (KEY LIST)
  • Enables (KEY ON) or disables (KEY OFF) the display of their content
    • on line 24 of text modes SCREEN 0, 1, 9
    • on line 13 of Kanji text modes 0 and 1, activated with CALL KANJI
    • on line 24 of Kanji text modes 2 and 3, activated with CALL KANJI
  • Changes the text displayed at the bottom of the screen

Syntaxes

  • KEY ON|OFF|LIST
  • KEY <number>,"<string>"

Parameters

ON/OFF enables/disables display of the function key text at the bottom of the screen. It is only displayed in text screen modes.

LIST is used to list the contents of the function keys.

<number> is the function key number. (1~10)

<string> is a text of up to 15 characters allocated for each function key.

When pressing the specific function key in direct mode the text is displayed at the location of the cursor. This allows quick entry of text or instructions that are often used. The function key text will also be displayed on the last line of the screen, if this feature is active, which is the default.

If the text contains a instruction and you want to have automatically executed upon pressing the function key, add +CHR$(13) at the end of the string. This corresponds to the RETURN/ENTER key.

During a program execution pressing a function key will have the same effect as you press each key corresponding at characters in text with in extra the call to the routine defined by ON KEY GOSUB. The text will not be displayed except during the execution of INPUT.

Note: To go back completely to the default function keys, you need to use DEFUSR=&H3E : X=USR(0) : KEY ON

Example

10 A$="FILES"+CHR$(13)
20 KEY 1,A$+"?DSKF(0)"+CHR$(13)

Standard function keys

By default, the contents of the function keys are as following (complete display with KEY LIST):

Japanese and Korean machines

Also for Philips VG-8000 and VG-8010 (not the 8010F version), Sanyo PHC-28S

Key Display Command Key Display Command
F1 color COLOR F6 color 15,4,7 COLOR 15,4,7 + RETURN
F2 auto AUTO F7 (*) cload" CLOAD"
F3 goto GOTO F8 cont CONT + RETURN
F4 list LIST F9 list. LIST. + RETURN
F5 run RUN + RETURN F10 run CLS:RUN + RETURN

(*) load" for LOAD" on MSX2+ and MSX Turbo R machines

European, Argentinian and Russian MSX/MSX2 machines

Also for Sharp HB-8000-11 and HB-8000-12, Arabic versions of Spectravideo SVI-728 and SVI-738, Arabic machines in European mode

On Yamaha YIS-503IIR, the network needs to be disabled: boot while pressing DEL key.
On Arabic machines, the Arabic mode needs to be disabled: boot while presssing CTRL key.

Key Display Command Key Display Command
F1 color COLOR F6 color 15,4,4 COLOR 15,4,4 + RETURN
F2 auto AUTO F7 cload" CLOAD"
F3 goto GOTO F8 cont CONT + RETURN
F4 list LIST F9 list. LIST. + RETURN
F5 run RUN + RETURN F10 run CLS:RUN + RETURN

Brazilian MSX machines

Key Display Command Key Display Command
F1 color COLOR F6 (*) color 15,1,1 COLOR 15,1,1 + RETURN
F2 auto AUTO F7 cload" CLOAD"
F3 goto GOTO F8 cont CONT + RETURN
F4 list LIST F9 list LIST
F5 run RUN + RETURN F10 run RUN

(*) color 15,4,4 on Sharp HB-8000-14

Non-standard function keys

Daewoo Zemmix CPC-50A, CPC-50B and CPC-51

These machines are conceived as consoles, not as computers. On the real hardware, it's impossible to use MSX-BASIC. On emulators, you can access to MSX-BASIC but by default, the contents of the function keys are empty.

Frael Bruc 100

This MSX clone never displays the contents of the function keys, even if you use KEY ON. However, you can list these contents with KEY LIST and use KEY to change them.

Key Display Command Key Display Command
F1 keylist KEY LIST + RETURN F6 color COLOR
F2 cload" CLOAD" F7 csave" CSAVE"
F3 auto AUTO F8 renum RENUM
F4 list. LIST. + RETURN F9 list LIST
F5 run RUN F10 cont CONT + RETURN

Philips NMS 800 and NMS 801

These machines are not fully MSX compatible, as they don't have any cartridge slot. They are conceived for games on cassette.

Key Display Command Key Display Command
F1 run"cas:" RUN"cas:" + RETURN F6 color 15,4,4 COLOR 15,4,4 + RETURN
F2 bload"cas:",r BLOAD"cas:",r + RETURN F7 cont CONT + RETURN
F3 cload CLOAD + RETURN F8 cload" CLOAD"
F4 load"cas:",r LOAD"cas:",r + RETURN F9 list LIST
F5 run RUN + RETURN F10 run CLS:RUN + RETURN

Brazilian MSX2 machines with MSX-BASIC 2.2

Key Display Command Key Display Command
F1 Copy COPY F6 Color 15,1,1 COLOR 15,1,1 + RETURN
F2 Files FILES + RETURN F7 _Format CALL FORMAT + RETURN
F3 Bload' BLOAD" F8 _System CALL SYSTEM + RETURN
F4 List LIST F9 Load" LOAD"
F5 Run RUN + RETURN F10 Save" SAVE"

Brazilian MSX2+ machines with MSX-BASIC 3.1 or 3.2

Key Display Command Key Display Command
F1 files FILES + RETURN F6 color 15,0,0 COLOR 15,0,0 + RETURN
F2 bload" BLOAD" F7 load" LOAD"
F3 copy COPY F8 _format CALL FORMAT + RETURN
F4 list LIST F9 _system CALL SYSTEM + RETURN
F5 run RUN + RETURN F10 run CLS:RUN + RETURN

Function keys defined by software

Firmware of Arabic MSX/MSX2 machines

By default, the Arabic mode of these computers (except Arabic versions of Spectravideo SVI-728 and SVI-738) is enabled and the content of the function keys is modified for F2 and F6 to F8:

Key Display Command Key Display Command
F1 color COLOR F6 _dcolor CALL DCOLOR
F2 _arb1 CALL ARB1 F7 _arb2 CALL ARB2
F3 goto GOTO F8 (*) _engl CALL ENGL
F4 list LIST F9 list LIST. + RETURN
F5 run RUN + RETURN F10 run CLS:RUN + RETURN

(*) _latin for CALL LATIN on Sakhr/Al Alamiah AX-170F and AX-350IIF

Firmware of Yamaha YIS-503IIR

By default, the network firmware is enabled and the content of the function keys is modified for F1 and F6 to F10:

Key Display Command Key Display Command
F1 color PRINT F6 run"COM:" RUN"COM:"
F2 auto AUTO F7 save"COM:" SAVE"COM:"
F3 goto GOTO F8 load"COM:" LOAD"COM:"
F4 list LIST F9 merge"COM:" MERGE"COM:"
F5 run RUN + RETURN F10 _comterm CALL COMTERM + RETURN

Connection of a Quick Disk Drive

When booting a MSX computer with a Quick Disk Drive connected, you will see that the contents of most function keys have been modified as following:

Key Display Command Key Display Command
F1 RUN _ CALL RUN F6 (**) color 15,4,7 COLOR 15,4,7 + RETURN
F2 LOAD _ CALL LOAD F7 QDKEY _ CALL QDKEY
F3 BLOAD _ CALL BLOAD F8 SAVE ("QD: _ CALL SAVE ("QD:
F4 (*) list LIST F9 BSAVE ("QD: _ CALL BSAVE ("QD:
F5 (*) run RUN + RETURN F10 FILES _QD CALL QDFILES

(*) Generally unchanged
(**) Unchanged on Japanese machines, Korean machines, Philips VG-8000 and VG-8010 (not the 8010F version), Sanyo PHC-28S

Related to

KEY(), ON KEY GOSUB

Compatibility

MSX-BASIC 1.0 or higher