H-19 Programming Information
Here you will find information useful to programmers who want to control the H-19 terminal. We'll describe the character sequences generated by the function keys, and all the Heath-mode escape sequences that this implementation responds to.
Please note that this emulator implements only the Heath versions of the escape sequences, not the ANSI versions, and that there are a small number of functions that are not supported (though they will do no harm if you use them). These limitations are described on the Emulator Limitations help page. They are also pointed out in the appropriate section below.
Please refer to the H-19 Keyboard Map and User Guide page for the keyboard layout.
Page Index |
H-19 Keyboard Information Function Keys Keypad Keys Extra Mac Keys H-19 Escape Sequences Cursor Functions Erasing and Editing Configuration Modes of Operation Additional Functions |
H-19 Keyboard Information
Function Keys
H-19 Key |
Mac Key Extended Kb |
Mac Key Normal Kb |
Sequence |
F1 | F1 | option 1 | esc S |
F2 | F2 | option 2 | esc T |
F3 | F3 | option 3 | esc U |
F4 | F4 | option 4 | esc V |
F5 | F5 | option 5 | esc W |
Blue | F6 | option 6 | esc P |
Red | F7 | option 7 | esc Q |
Gray | F8 | option 8 | esc R |
Erase | clear | clear | esc J |
shift-Erase | shift-clear | shift-clear | esc E |
Keypad Keys
Key Output Sequence | ||||
H-19 Keypad |
Mac Keypad |
Normal mode | Shifted mode | Alt. mode |
Enter | Enter | carriage return | carriage return | esc ? M |
. | . | . | . | esc ? n |
0 | 0 | 0 | 0 | esc ? p |
1 | 1 | 1 | esc L | esc ? q |
2 | 2 | 2 | esc B | esc ? r |
3 | 3 | 3 | esc M | esc ? s |
4 | 4 | 4 | esc D | esc ? t |
5 | 5 | 5 | esc H | esc ? u |
6 | 6 | 6 | esc C | esc ? v |
7 | 7 | 7 |
esc @ (*) esc O (*) |
esc ? w |
8 | 8 | 8 | esc A | esc ? x |
9 | 9 | 9 | esc N | esc ? y |
* - The insert key sends ESC @ if the terminal is not in insert mode, and ESC O if the terminal is in insert mode.
Extra Mac Keys
Output Sequence
(for given keypad mode and shift-key state) |
||||||||
Normal | Shifted | Alt. | Alt. Shifted | |||||
Shift Key > | Up | Down | Up | Down | Up | Down | Up | Down |
cursor up | esc A | esc A | esc A | esc A | esc ? x | esc A | esc A | esc ? x |
cursor down | esc B | esc B | esc B | esc B | esc ? r | esc B | esc B | esc ? r |
cursor right | esc C | esc C | esc C | esc C | esc ? v | esc C | esc C | esc ? v |
cursor left | esc D | esc D | esc D | esc D | esc ? t | esc D | esc D | esc ? t |
home | esc H | esc H | esc H | esc H | esc ? u | esc H | esc H | esc ? u |
forward del | esc N | esc N | esc N | esc N | esc ? y | esc N | esc N | esc ? y |
Some explanation is in order. Programs such as PIE may put the keypad into alternate mode or shifted-alternate mode. We want these extra Mac keys to respond the same as the corresponding keys on the H-19 keypad under these conditions, in order to produce the result that the user expects.
In fact, we want these six keys to be exactly like the H-19 keypad keys, except that they will always produce shifted escape sequences instead of numbers.
So, in summary:
H-19 Escape Sequences
Cursor Functions
Escape Sequence | Mnemonic | Definition |
esc H | HCUH | cursor home |
esc C | HCUF | cursor forward |
esc D | HCUB | cursor backward |
esc B | HCUD | cursor down |
esc A | HCUU | cursor up |
esc I | HRI | reverse index |
esc n | HCPR | cursor position report |
esc j | HSCP | save cursor position |
esc k | HRCP | set cursor to previously saved position |
esc Y r c | HDCA | direct cursor addressing |
Additional information:
With the exception of HRI, none of the cursor-motion sequences in this table will cause the screen to scroll or move the cursor past the margins of the screen. For example, HCUU on line 1 will leave the cursor on line 1.
HCUU and HCUD do nothing when the cursor is on line 25.
The response to Cursor Position Report is the sequence "esc Y r+31, c+31" where 'r' and 'c' are the current cursor row and column.
Reverse Index is Line Feed in reverse. HRI will move the cursor up one row. When issued with the cursor on line 1, the screen is scrolled down one line and a new blank line is opened on line 1.
(Note: The character following esc is an upper-case I ("eye")).
Position the cursor to a specific row and column. The cursor is positioned to row 'r'-31 and column 'c'-31. If the resulting row is invalid, the cursor stays on its current row. If the resulting column is invalid, the cursor moves to column 80.
Direct Cursor Addressing is the only way to move the cursor to line 25. Line 25 must be enabled before moving the cursor there. Otherwise, it's considered to be invalid and the cursor will stay in its current row.
Erasing and Editing
Escape Sequence | Mnemonic | Definition |
esc E | HCD | clear display (shift erase key) |
esc b | HBD | erase beginning of display |
esc J | HEOP | erase to end of page (erase key) |
esc l | HEL | erase entire line |
esc o | HEBL | erase beginning of line |
esc K | HEOL | erase to end of line |
esc L | HIL | insert line |
esc M | HDL | delete line |
esc N | HDCH | delete character |
esc @ | HEIM | enter insert character mode |
esc O | HERM | exit insert character mode |
Additional information:
After an insert line, the cursor is left in column 1 of the inserted line.
After a delete line, the cursor is left in column 1 of the line following the deleted line. A new blank line is inserted on line 24.
The character following the esc is a lower case L ("ell").
Configuration
Escape Sequence | Mnemonic | Definition |
esc z | HRAM | reset to power up configuration |
esc x [n] | HSM | set (enable) operating mode |
esc y [n] | HRM | reset (disable) operating mode |
The following Configuration Modes replace the [n] in the HSM and HRM sequences above.
Configuration Mode | Definition |
1 | enable/disable line 25 |
3 | enable/disable hold screen mode |
4 | enable/disable block cursor |
5 | enable/disable cursor off |
6 | enable/disable shifted keypad |
7 | enable/disable alternate keypad mode |
8 | enable/disable auto line feed on receipt of CR |
9 | enable/disable auto CR on receipt of line feed |
Additional information:
A real H-19 will also support:
These are not supported by this emulator. You can send the sequences to the terminal and they will be "eaten" but not processed.
Reset the H-19 terminal emulator to its power-up configuration: 25th line off, preferred cursor, hold-mode disabled, normal video, no graphics. The screen is cleared and the cursor homed. A 'transmit page' or 'transmit line 25' operation in progress is halted early by sending Carriage Return and ringing the bell.
Please notice the odd case, here: You are enabling the cursor to be off, and disabling that condition to turn the cursor on.
Modes of Operation
Escape Sequence | Mnemonic | Definition |
esc [ | HEHS | enter hold screen mode |
esc \ | HXHS | exit hold screen mode |
esc p | HERV | enter reverse video mode |
esc q | HXRV | exit reverse video mode |
esc F | HEGM | enter graphics mode |
esc G | HXGM | exit graphics mode |
esc t | HEKS | enter keypad shifted mode |
esc u | HXKS | exit keypad shifted mode |
esc = | HAKM | enter alternate keypad mode |
esc > | HXAM | exit alternate keypad mode |
Additional information:
You can toggle hold screen mode locally by typing command-Scroll (that's command F9 or command-option-9). This local toggle does not transmit escape sequences to the H8.
The keypad in alternate mode replaces the normal mode; it is not possible to get the digits 1-9 from the keypad until you exit alternate keypad mode.
The shifted-mode sequences are not affected by alternate keypad mode.
Shifted keypad mode reverses the shift mode of the keypad. For example: when in keypad shifted mode pressing '1' will send the Insert Line sequence, while pressing shift-1 will send either '1' or esc ? q, depending on the alternate keypad mode setting. (Ref: Keypad Keys table)
The graphics characters are associated with the normal ASCII characters from 136Q ('^') through 176Q ('~') inclusive. Following is a list of these ASCII characters and their associated graphics characters.
Additional Functions
Escape Sequence | Mnemonic | Definition |
esc v | HEWA | wrap around at end of line |
esc w | HXWA | discard at end of line |
esc Z | HID | identify as VT52 (send esc K) |
esc ] | HX25 | transmit 25th line |
esc # | HXMP | transmit page |
cr | carriage return | |
lf | line feed | |
bel | bell | |
tab | horizontal tab | |
bs | backspace |
Additional information:
A real H-19 will also support enable/disable keyboard (esc { and esc }). These are ignored in this emulator.
Sending HID simply causes the emulator to return esc K.
These sequences will cause line 25 or lines 1-24 to be transmitted to the H8. Transmission proceeds as follows:
Due to the enter/exit reverse video and graphics sequences, the amount of data returned can be significantly more than the 80 or 1,920 characters on lines 25 and the main screen body, respectively. For example, if the last two characters on the screen are a normal character followed by a reverse-video graphics character, the last character of the screen will actually cause nine characters to be transmitted: enter reverse video, enter graphics, the character, exit reverse vide, and exit graphics.
If there is a long string of text in a particular mode, the mode is changed only at the beginning and end of the string.
If line 25 is not enabled, HX25 will return only a carriage return.
Tab will cause the cursor to move to the next tab stop. The tab stops are fixed at columns 8, 16, 24 , 32, 40, 48, 56, 64, 72, 73, 74, 75, 76, 77, 78, 79 and 80. A tab in column 80 will not move the cursor.
Tab moves the cursor over the characters on the screen. Blanks are neither inserted nor written over the characters on the screen.