Module keyboard

Module keyboard 

Source
Expand description

This module implements the keyboard of the Lincoln Writer.

A diagram of the keyboard layout appears in the Lincoln Lab Division 6 Quarterly Progress Report, 15 June 1958 (Fig. 63-7, on PDF page 38, page numbered 24). This diagram is presumably to scale but dimensions are not given on it. The Lincoln Writer actually has two keyboards. The keyboard nearest the typist contains decimal digts, majuscule letters (ABC, etc.), the space bar and a few others. The keyboard further from the typist contains some minuscule latin letters, some Greek letters (minuscule and majuscule) and some symbols (hand, *, arrow, #, ?).

The near keyboard produces the symbols shown in the left-hand column of the character set shown in table 7-6 of the TX-2 Lincoln Technical manual, and the far keyboard contains the symbols shown in the right-hand column.

Carriage return sets the Lincoln Writer to lower case (and normal script). See pages 4-37 to 4-42 of the User Handbook. Since this is presumably for convenience in the common case, and since there is not a full set of minuscule (“abc…”) letters on the Lincoln Writer, I infer this to mean that the keyboard farthest from the typist, containing the keys “hijk<>wxyz..” for example, is the in fact the “upper-case” keyboard. That is, those keys send the “UPPER CASE” (075) code if pressed at (for example) the beginning of a line.

NOTE: In “The Lincoln Writer” (Lincoln Laboratory Group report 51-8), the authors state that “The lower case keyboard was almost standard (our capital letters were put on the lower case)” (p8).

Also on p. 8 of the same document: “The keyboard is actually two separate Soroban coding keyboards mounted on the same block. The lower keyboard contains the buttons for all the lower case characters and the typewriter functions. Thew upper board contains the buttons for upper case character and a few special; codes.”

Lincoln Writer codes are not unique without knowing the upper/lower case state. For example, code 26 is sent for both “G” and “w”.

To make the code in this module slightly less confusing, we refer to the two keyboards as “Far” and “Near”. Assuming a case change is needed, “G” would be sent as 074 026 (074 signifying LOWER CASE) and “w” would be sent as 075 026 (075 signifying UPPER CASE). The documentation describes a hardware interlock which keeps a key pressed down while a shift code is sent, so I assume that shift code are only sent when necessary (e.g. “wGG” would be sent as 075 026 075 026 026). This is consistent with the description in “The Lincoln Writer” (Group Repport 51-8).

Some changes to the keyboard happened between Lincoln Lab Division 6 Quarterly Progress Report, 15 June 1958 (“PR”) and Group Report 51-8 (“GR”). Specifically, CONTINUE and HALT were removed and LINE FEED UP and LINE FEED DOWN were added. The order of the function keys was changed from:

  • DELETE
  • STOP
  • YES
  • NO
  • WORD EXAM
  • CONTINUE
  • HALT
  • BEGIN
  • READ IN

to:

  • DELETE
  • STOP
  • LINE FEED UP
  • LINE FEED DOWN
  • WORD EXAM
  • YES
  • NO
  • BEGIN
  • READ IN

Accordingly, CONTINUE is also not listed in Table 7-6 of the Technical Manual.

The documentation is inconsistent about the codes of some of the keys. These keys are:

YES: 73 according to the PR, 17 according to the TM.

NO: 72 according to the PR, 16 according to the TM.

LINE FEED UP: not listed in the PR, 73 according to the TM.

LINE FEED DOWN: not listed in the PR, 72 according to the TM.

The DELETE key in the PR is listed as NULLIFY in the TM.

The top-row keys READ IN (14) BEGIN (15), STOP (76), WORD EXAM (71) are coded consistently between the PR and the TM.

Using the size of a square key cap as 1x1, dimensions of the other parts of the keyboard are:

Total height of keyboard (between top of YES and bottom of space bar): 14.45 Total width of keyboard (between LHS of TAB and RHS of NORMAL): 19.7 (but see below).

On the RHS of the keyboard unit are three indicator lamps not included in the “width” figure above. These are circular and have diameter 0.5. Each is labeled on its LHS.

Dimensions (hw): Regular key: 11 Gaps between keys: 0.50.43 Space bar: 18.5 Wide key (for example RETURN): 1.71 Tall key (for example HALT): 1.71 Gap b/w upper and lower keyboards: 1.9 Whole unit (incl indicators): 23.8*14.5

An additional reference on the Lincoln Writer is The Lincoln Writer. J. T. Glmore, Jr., R. E. Sewell. Lincoln Laboratory Group report 51-8. October 6, 1959.

This states a number of things that are perhaps not yet reflected in this code:

  1. The box character just fits inside of the printing rectangle and can contain any other character (p7)
  2. The capital letters are larger than the numerals and small characters (p7)
  3. The numerals are slanted (p7).
  4. With the exception of the capital letters and a few punctuation characters, all characters can be circled (p7). (I interpret this as meaning that all characters can be combined with a circle, but the circle is not large enough to contain some of the characters.

Structs§

BoundingBox 🔒
HtmlCanvas2DPainter
Key 🔒
KeyLabel 🔒
Point 🔒

Enums§

Code 🔒
KeyColour 🔒
KeyPaintError
KeyShape 🔒
Room 🔒

Constants§

FONT_METRIC_FUDGE_FACTOR 🔒
When the ascent or descent font metrics for a text string are NaN, we fall back on the actual metrics (instead of font metrics). But the actual metrics don’t include the inter-line spacing, so we use a fudge factor to guess at something appropriate.
GAP_HEIGHT 🔒
GAP_WIDTH 🔒
HIT_DETECTION_BACKGROUND 🔒
HPOS_ARROW 🔒
HPOS_BACKSPACE 🔒
HPOS_BLACK 🔒
HPOS_DELETE 🔒
HPOS_LOGICAL_AND 🔒
HPOS_RETURN 🔒
HPOS_SPACE_BAR 🔒
HPOS_TAB 🔒
HPOS_TILDE 🔒
HPOS_Z 🔒
KEY_AND_GAP_WIDTH 🔒
KEY_HEIGHT 🔒
KEY_WIDTH 🔒
SWITCH_TO_FAR
SWITCH_TO_NEAR
TALL_KEY_AND_GAP_WIDTH 🔒
TALL_KEY_WIDTH 🔒
VPOS_ARROW 🔒
VPOS_BACKSPACE 🔒
VPOS_BLACK 🔒
VPOS_DELETE 🔒
VPOS_LOGICAL_AND 🔒
VPOS_RED 🔒
VPOS_RETURN 🔒
VPOS_SPACE_BAR 🔒
VPOS_TAB 🔒
VPOS_TILDE 🔒
WIDE_KEY_AND_GAP_WIDTH 🔒
WIDE_KEY_WIDTH 🔒

Traits§

KeyPainter 🔒

Functions§

all_keys 🔒
ascent 🔒
bounding_box_width 🔒
check_font_metric 🔒
descent 🔒
draw_kb 🔒
draw_keyboard
font_or_actual 🔒
Return the distance between the baseline of some measured text and the bottom of whatever would be avove it. We use font ascent instead of actual ascent, so that we get an appropriate amount of space between lines. This also gives us some consistency of appearance. However, if the font ascent metric is not available, we use the actual ascent with a “fudge factor”.
keep_greatest 🔒
room_for_key_padding 🔒
row0 🔒
row1 🔒
row2 🔒
row3 🔒
row4 🔒
row5 🔒
row6 🔒
row7 🔒
row8 🔒