UP | HOME
Impaktor

Impaktor

Inject Emacs intravenously

The Human–Machine interface: Keyboards
Published on Sep 26, 2022 by Impaktor.

NOTE: This post is adapted from a talk I gave 2022, which was well received – though possibly due to passionate delivery, rather than intrinsic interest of the topic?

Table of Contents

1. History of early typewriters

1.1. Sholes & Glidden Typewriter (1868)

  • Christopher L. Sholes, a Milwaukee newspaperman, poet, and part-time inventor
  • Similar to piano
  • All capital letters

piano1868.jpg

Figure 1: src

1.2. Hansen Writing Ball (1870)

Our writing instruments contribute to our thoughts, (1882)

  • Invented by danish pastor Rasmus Malling-Hansen (1865)
  • First commercial (2k produced)
  • Hand crafted manufacture
  • Friedrich Nietzsche received one directly from Hansen, due to failing vision. He did not like it (damaged in shipping).

hansen.jpg

Figure 2: src

1.3. Remington No.1 (1873)

(aka Sholes & Glidden Typewriter)

  • Remington had the infrastructure & mechanical skills
  • Remington wanted to diversify after civil war
  • 1k initial production

remington-1.jpg

Figure 3: src

1.4. Remington No.2 (1878)

  • First to be mass produced
  • Introduced shift key:
    • The typebars (NO: stenger) each had upper and lower characters
    • Pressing shift key shifted mechanism to use capital letters
    • Wikipedia writes: “The Shift key’s name originated from the typewriter, where one had to press and hold the button to shift up the case stamp to change to capital letters”
  • Mark Twain was the first author to submit a book manuscript in typed copy, having bought a typewriter for $125 in 1874.

remington-2.jpg

Figure 4: src

2. Legacy

2.1. Staggered vs Ortholinear layout

staggered.jpg

Figure 5: src

Consider introduction of Numpad on modern computers: It is Ortholinear, since it does not hearkens back to typewrites mechanical constraints.

2.2. Margins – Ragged right margin

It has been argued that the typewritten page was an influence in the move in book designs from justified lines to even-spacing between words and the uneven right-hand margins this causes

metroid.jpg

Figure 6: See tweet

(Above tweet refers to S U P E R M E T R O I D manual, which is formatted in mono space bricktext layout)

2.3. Keyboard layout

2.3.1. Keyboard layouts – QWERTY

jammed.jpg

bigrams.jpg

  • Optimize: minimum occurrences of adjacent key presses
  • ”R” was the last key to be moved to its current position, as a gimmick to be able to type ”typewriter” using only top row

2.3.2. Keyboard layouts – Dvorak (1936)

  • Optimized for alternating hands, for ”rhythmic” typing
  • Vowels & symbols on left
  • Most common used consonants on right home row
  • Supported by all OS out of the box
  • But is it better? Stackoverflow debates.

dvorak.jpg

Figure 7: src

2.3.3. Keyboard layouts – Colemak (2006)

Consider finger travel.

QWERTY: Fingers move 2.2x more than on Colemak. QWERTY has 16x more same hand row jumping than Colemak. There are 35x more words you can type using only the home row on Colemak.

  • Optimize: Reduce finger travel
  • Optimize: Reduce pinky use (compared to Dvorak)
  • Constraint: Be similar to QWERTY, for easy transition

colemak.jpg

Figure 8: src

2.3.4. Keyboard layouts – Workman (2010)

Consider hand anatomy, which finger movements are hard/easy

  • Optimize: Reduce horizontal finger movement
  • Optimize: minimize cost function based on hand anatomy / finger length

workman_layout.jpg

Figure 9: Basic layout. src

keyboard_graded.jpg

Figure 10: Cost of finger travel for staggered layout. src

keyboard_graded_grid.jpg

Figure 11: Cost of finger travel for ortholinear layout. src

Usage of middle column: QWERTY: 22%, Dvorak: 14%, Colemak: 12%; Workman: 6%

workman1.jpg

Figure 12: src

There are many other layouts, e.g. Arensito (2001, by Håkon Hallingstad, for Norwegian), or BEAKL for ortholinear/split, or T-34, the latter concludes with I designed my own keyboard layout. Was it worth it?.

2.4. Carriage Return / Line Feed

  • Line feed means moving one line forward \n
  • A carriage return means moving the cursor to the beginning of the line. The code is \r
  • Line Feed: (ASCII 10, \n)
  • Carriage return: (ASCII 13, \r),

crlf.jpg

Figure 13: src

Gives new line:

CRLF
Windows (e.g. Notepad), HTTP- and MIME-mail headers
LF
Unix, OSX, GNU/Linux

For more, see stackoverflow

2.5. Tilt: Don’t do it!

tilt.jpg

Figure 14: src

Microsoft Ergonomics 4000 (great cheap ergonomic keyboard!) and predecessor to Microsoft Sculpt Ergonomic Desktop.

ms4000.jpg

Figure 15: src

3. Modern electric era

3.1. IBM Selectric (1961)

  • Electric, highly innovative
  • Used a typeball, instead of typebar (aka ”golf ball”) which rotates \(+\) pivots at high speed (14.8 characters per second)
  • Allowed changing fonts
  • 75% of market, by 1986 13M sold

ibm_selectric.jpg

Figure 16: src

selectric_hadar.jpg

Figure 17: src

3.2. ADM-3A Terminal (1974)

  • Vim legacy: HJKL navigation keys; ESC. Colon : not on shifted layer
  • Symbols: ~ and HOME on same key (consider Unix/Linux: ~/ alias for Home folder)

terminal_ADM-3A-s.jpg

Figure 18: src

LSI-ADM3A-full-keyboard.jpg

Figure 19: src

3.3. Symbolics ”Space cadet” (1974)

  • Symbolics lisp machines, (only 100 sold)
  • Holy grail of keyboards, seminal in hacker culture
  • Magnetic switches based on Hall Effect, contactless, rated at 30B presses / key

symbolics-keyboard-1.jpg

Figure 20: src, youtube

  • 8000 characters, by combining keys and modifiers
  • 7 modifier keys: top, Greek, Shift, Hyper, Super, Meta (alt), Ctrl,
  • APL symbols, & Greek symbols on each key
  • Keycaps: double shot ABS Honeywell

space_cadet_zoom.jpg

Figure 21: src

See gallery for more.

4. Keys

4.1. Keycaps

There’s a large community obsessing over keycaps, designing their own set, and having them produced as a mass-buy / kickstarter on massdrop.com. One article detailing the work is: What Goes Into Creating A Custom Keycap Set

4.1.1. Printing technique

Character engraving techniques, dropping price order:

  1. Double-shot: two different injection modded plastics. Almost always ABS, very expensive
  2. Dye sublimated: can bleach / pale & fuzzy edges. Keycap is heated, then dye sinks into the plastics. For PBT, not ABS, as it tends to burn
  3. Laser engraving: will eventually wear off
  4. Pad printing: sticker, standard on all cheap keyboards

doubleshot.jpg

Figure 22: Example of double shot key. src

injection_molded.jpg

Figure 23: Triple shot (rare)

4.1.2. Key plastics

  • ABS (Acrylonitrile Butadiene Styrene): Dense, durable, low cost. Used for double shot, will shine with age, and yellow (Retr0Bright). Surface will dissolve if rubbed in aceton.
  • PBT (Polybutylene Terephthalate): Less dense, higher cost, resistant to “shine”. Used for dye sublimation, textured surface. Shrinks in heating process \(\rightarrow\) difficult to make space bar (IBM could pull it of).

pbt_abs.jpeg

Figure 24: Apple keyboard with PBT keys, except large parts like spacebar and case made from ABS (yellowed). src

For more, see: Chyrosran22: Keycaps for mechanical keyboards

4.1.3. Keycap profiles

Keys are usually unique to its row

keycaps_profiles.jpg

Figure 25: src

4.2. Why Mechanical keyboards?

4.2.1. Membrane keyboard

Rubber membrane, dirt-cheap, key activates at bottom (ouch, can hurt finger joints)

membrane.jpg

Figure 26: src

4.2.2. Mechanical Keyboard

Each key has its own switch.

mechanical-keyboard-switches.jpg

Figure 27: src

4.3. Key switches

4.3.1. Mechanical key switch characteristics

force.png

Figure 28: src

Most common switch: Cherry MX (Alps/Matias, Kailh, Gateron, Zeal, Outemu)

  • Blue - clicky & tactile
  • Brown - tactile
  • Red - linear

Some variables: Plastic type, lubrication, tactility, activation point, bottom-out, spring force, rubber dampening, click-mechanism, contact type (optical, Hall effect/magnetic…) etc. See switch table.

Membrane / rubber dome activates when bottoming out (pressing key all the way down), while mechanical switches (often) activate halfway.

For more: Membrane vs Mechanical Keyboard – Everything you Need to Know

4.3.2. Buckling springs

  • Generally considered the best clicky switch ever made
  • Rated at 100M key presses
  • Same mechanism does the tactile click, contact and sound
  • Capacitive — inherent N-key rollover (NKRO)

ModelFdiagram.jpg

Figure 29: Catastrophically buckling compression column switch and actuator src

4.3.3. IBM Model F (1981-1994)

  • First buckling spring keyboard (For IBM 5051 PC)
  • 4 kg, cast zinc, each key rated at 100M key presses
  • New production: modelfkeyboards.com

ibm-model-f.jpg

Figure 30: src

4.3.4. IBM Model M (1985-1996)

ibm-model-m.jpg

Figure 31: src

  • Standard layout of today, ISO standard (1994)
  • IBM + Lexmark produced 10M (now Unicom, still making them)
  • Swappable key caps, curved backplate, all keys same shape
  • 2-key rollover

4.4. Key Rollover / Ghosting

\(N\)-key rollover = guaranteed to register \(N\) simultaneous keys (NKRO)

nkro.gif

Figure 32: src

  1. A,S,X are pressed simultaneously
  2. Z key is registered as pressed as well, even though switch is open

There is a keyboard N-key rollover test (e.g. press “ASDFJKL”).

5. Ergonomic keyboards

5.1. Maltron 1977 (single hand)

Lillian Malt, secretary training school (1955-)

maltron_single.jpg

Figure 33: src

5.2. Maltron 1977 (dual hand)

  • Thumb cluster, use strongest fingers
  • Ortholinear (rather than staggered)
  • Shoulder width
  • Arched key wells,
  • Different height for each column, since fingers different length

maltron.jpg

Figure 34: src

5.3. Kinesis Advantage (1992)

1997: Contact - Flubber - MIB

kinesis_in_movies_contact.jpg

Figure 35: Contact

kinesis_in_movies_flubber.jpg

Figure 36: Flubber

kinesis_in_movies_mib.jpg

Figure 37: MIB

5.4. Kinesis Advantage (1992)

  • Better production / lower cost
  • De facto standard keyboard for programmers & typists
  • Many mods, e.g. kinx-project: PCB+Arduino replacement with QMK

kinesis.jpg

Figure 38: Classic Kinesis Advantage

5.5. Ergodox (2011) / Ergodox EZ / Iris / Moonlander

ergodox.jpg

Figure 39: src

5.6. Dactyl

Curved & layout like Kinesis, but split like Ergodox.

dactyl.jpg

Figure 40: Made by Matt Adereth (in Lisp!) of Two Sigma Investments.

5.7. Dactyl Manuform

my_manuform_above.jpg

Figure 41: My Manuform build, from above

my_manuform_below.jpg

Figure 42: My Manuform build, from below

manuform.jpg

Figure 43: src

5.8. QMK — open source keyboard firmware

  • Supports Teensy, and Arduino microcontrollers
  • Free software
  • Macros
  • Mouse keys (control mouse from keyboard)
  • Layers

Special functions, giving multiple purpose keys

  • Combination of multiple keys
  • ”Tap-dance”, e.g. single tap \(\rightarrow\) :, double tap \(\rightarrow\) ;
  • Sticky one-shot keys, e.g.
    • tap Ctrl, (release), next <key> will be registered as Ctrl+<key>
  • Hold vs. tap, e.g.
    • press ESC vs. hold ESC, or
    • tap SHIFT vs. hold SHIFT
  • For example, with above one can setup parenthesis (or bracket) on shift keys:
    • tap LSHIFT \(\rightarrow\) ( and
    • tap RSHIFT \(\rightarrow\) )

6. Remapping keyboard

6.1. Useful remapping

  • Programming languages assume US-layout
  • Keyboard layout I’ve used for +15 years, on both laptop and external (Kinesis Advantage) keyboard:

mylayout-kinesis.jpg

mylayout-laptop.jpg

Tools for configuring above keyboard layout in software, on:

GNU/Linux
Xmodmap, autokey, or keyd
OSX
karabiner
Win
autohotkey.com

6.2. Xmodmap config

Place code in ~/.Xmodmap, use xev to find keycode

! altgr + "p" --> "~", asciitilde better than dead_tilde
keycode 33 = p P p P asciitilde NoSymbol

! "altGr" + "i", "o" -->  "{", "}"
keycode 31 = i I i I braceleft NoSymbol
keycode 32 = o O o O braceright NoSymbol

! altgr + "k" / "l" --> "<" / ">"
keycode 45 = k K k K less
keycode 46 = l L l L greater

For full code, see my config files on github

Bonus: Code to disable laptop-keyboard (to put external keyboard on top of laptop keyboard).

6.3. Honourable mention: DataHand (1990–2008)

datahand.jpg

Figure 46: Oringal DataHand src

geekhack.jpg

Figure 47: DIY build from geekhack src

7. Appendix

7.1. Two great PyCon talks:

7.2. Other keyboards:

7.3. Further reading

7.3.1. Split Keyboard Galleries

7.3.2. Forums

7.3.3. Keyboard switches

7.3.4. Keyboard layout

E.g. 40% keyboards: instead of moving your hands to the keys, move the keys to the fingers. All keys maximum one key distant.

7.3.6. Miscellaneous