Breakout, the game the course builds in HiSoft C, running on the Tatung Einstein: coloured brick rows, the bat and the ball on a black court
← Back to Courses
module
39

Appendix IV - The Keyboard

Three keyboards meet in this course: the Einstein's own, the modern one under MAME, and the editor's command keys. This appendix has all three in one place. Sections say "In MAME:" wherever the two machines differ; the tables here are the full set.

The Characters C Needs

The Einstein's keyboard has no {, }, \, |, [, ], ^ or ~ keys. They are made with the arrow keys and the ½ key, and the screen draws them as fractions and arrows - which is right, and not an error (S3).

CharacterOn the EinsteinIn MAMEDrawn on screen as
[LEFT arrowLeft arrow
{SHIFT and LEFTShift and Left¼
]RIGHT arrowRight arrow
}SHIFT and RIGHTShift and Right¾
^UP arrowUp arrow
~SHIFT and UPShift and Up÷
|½\
\SHIFT and ½Shift and \½
_- key-_
`SHIFT and -Shift and -`
?SHIFT and /Shift and /?

Everything else is where its label says. The Einstein starts with CAPS LOCK on; press it once before typing a program, because C's names are case-sensitive and MAIN is not main (S4). The prompt does not mind either way.

The Control Keys

EinsteinIn MAMEDoes
ENTERReturnEnds a command or a line
DELETEBackspaceRubs out the character to the left
GRPHF8ED80's command key (below)
CONTROLControlNot used by ED80 on the course disc - it inserts ^E and the like (S5)
BREAKLeft OptionNothing this course needs; it does not stop a C program (S7)
CAPS LOCKCaps LockToggles capitals; on at start

MAME's own control keys - Esc to quit, F3 to reset - start switched off so that the Einstein gets every key; forward delete on a Mac, or Scroll Lock on Windows, switches them on and off again (S3).

ED80

GRPH and a letter, the letter pressed while GRPH is held. Where two keys are shown, the first is a prefix: press it, let go, and press the second.

KeysDoes
GRPH-S, GRPH-DLeft a character, right a character
GRPH-A, GRPH-FLeft a word, right a word
GRPH-E, GRPH-XUp a line, down a line
GRPH-CDown a screenful; on a short file, to the end
GRPH-Q then DTo the end of the line
GRPH-Q then RTo the start of the file
GRPH-Q then CTo the end of the file
DELDelete the character to the left
GRPH-GDelete the character under the cursor
CTRL-YDelete the whole line
GRPH-VSwitch between inserting and overwriting
GRPH-O then IAuto-indent on and off (I/AUTO in the status line)
GRPH-JThe help screen; ENTER returns
GRPH-K then XSave and exit: Filename:, ENTER accepts
GRPH-K then QExit without saving: Abandon text: Sure?, Y

The status line is wider than the screen and wraps over the first line of text (S5); the text is still there.

At The Compiler

After an error the compiler waits: E opens ED80 on the faulty line, and any other key returns to the prompt (S7). DIR pauses when the screen is full and takes the next key as "continue" (S6).

What A Program Sees

The codes kbd() and rawin() return (S22):

KeyCodeAs a character
LEFT91[
RIGHT93]
UP94^
DOWN10line feed
SPACE32' '
ENTER13carriage return
A to Z65 to 90'A' to 'Z', with CAPS LOCK on
0 to 948 to 57'0' to '9'

A key seen by kbd() is not taken, and waits for the prompt; a program that uses kbd() ends with gets (S22). No key stops a running C program (S7): a loop that must be stoppable watches the keyboard itself, and Q is the course's convention.

Get the Newsletter

New guides, disk images and community finds, roughly once a quarter. No spam, we promise, this isn't Tatung's marketing department.
Your subscription could not be saved. Please try again.
Your subscription has been successful.

Newsletter

Subscribe to our newsletter and stay updated.