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 Modules
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 keys marked {, }, \, |, [, ], ^ or ~. They are made with three keys marked with arrows, which are character keys and not the cursor keys, and with the ½ key; the screen draws them as fractions and arrows, which is right, and not an error (Module 3).

CharacterOn the EinsteinIn MAMEDrawn on screen as
[the ← keyLeft arrow←
{SHIFT and ←Shift and Left¼
]the → keyRight arrow→
}SHIFT and →Shift and Right¾
^the ↑ keyUp arrow↑
~SHIFT and ↑Shift 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 (Module 4). 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 (Module 5)
BREAKLeft OptionNothing this course needs; it does not stop a C program (Module 7)
CAPS LOCKCaps LockToggles capitals; on at start
the horizontal cursor keyTabNothing useful: ED80 puts ^D in the text, or ^H with SHIFT; kbd() sees 4, or 8 with SHIFT
the vertical cursor keyDown arrowED80 puts ^J in the text, or ^K with SHIFT; kbd() sees 10, or 11 with SHIFT

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 (Module 3).

The Cursor Keys

The Einstein does not have four arrow keys. It has two grey cursor keys, side by side at the right-hand end of the QWERTY row, each marked with a double-headed arrow:

KeyOn its ownWith SHIFT
the horizontal cursor keycursor rightcursor left
the vertical cursor keycursor downcursor up

Three other keys have a single arrow printed on them, but they are ordinary character keys, and the arrow is the character they type: the Einstein draws [ as a left arrow, ] as a right arrow and ^ as an up arrow.

KeyWhere it isTypesWith SHIFT
← (marked ¼ and ←)end of the QWERTY row, next to the cursor keys[{
→ (marked ¾ and →)end of the ASDF row, next to ENTER]}
↑ (marked ÷ and ↑)the number row, between = and ½^~

In MAME the two cursor keys are on your Tab key and your Down arrow: Tab is right, Shift and Tab is left, Down is down, and Shift and Down is up. Your Left, Right and Up arrows are the three character keys: Left types [, Right types ] and Up types ^. That is why MAME users so often report that the Einstein's arrow keys type brackets and do not move the cursor. The keys under those three arrows are not the cursor keys.

In ED80 on the course disc the cursor keys do not move the cursor. Each puts a control character into your text: ^D for the horizontal key, ^H with SHIFT, ^J for the vertical key and ^K with SHIFT. DEL takes it out, and GRPH-S, GRPH-D, GRPH-E and GRPH-X (below) do the moving. A program reading the keyboard with kbd() sees the four as 4, 8, 10 and 11 (Module 22).

Tatung's own manual describes the two cursor keys and the keyboard this way, and MAME's Einstein agrees with it. What the keys do in C on the course disc was checked in MAME, not on a real Einstein. If you have one and it behaves differently, please let us know and this page will be corrected.

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 (Module 5); 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 (Module 7). DIR pauses when the screen is full and takes the next key as "continue" (Module 6).

What A Program Sees

The codes kbd() and rawin() return (Module 22):

KeyCodeAs a character
the ← key (Left arrow in MAME)91[
the → key (Right arrow in MAME)93]
the ↑ key (Up arrow in MAME)94^
the vertical cursor key (Down arrow in MAME)10line feed
SHIFT and the vertical cursor key11
the horizontal cursor key (Tab in MAME)4
SHIFT and the horizontal cursor key8backspace
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 (Module 22). No key stops a running C program (Module 7): 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.