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
- 2. Legacy
- 3. Modern electric era
- 4. Keys
- 5. Ergonomic keyboards
- 6. Remapping keyboard
- 7. Appendix
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
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).
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
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.
Figure 4: src
2. Legacy
2.1. Staggered vs Ortholinear layout
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
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
- 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.
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
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
Figure 9: Basic layout. src
Figure 10: Cost of finger travel for staggered layout. src
Figure 11: Cost of finger travel for ortholinear layout. src
Usage of middle column: QWERTY: 22%, Dvorak: 14%, Colemak: 12%; Workman: 6%
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
),
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!
Figure 14: src
Microsoft Ergonomics 4000 (great cheap ergonomic keyboard!) and predecessor to Microsoft Sculpt Ergonomic Desktop.
Figure 15: src
3. Modern electric era
3.1. IBM Selectric (1961)
3.2. ADM-3A Terminal (1974)
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
- 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
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:
- Double-shot: two different injection modded plastics. Almost always ABS, very expensive
- 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
- Laser engraving: will eventually wear off
- Pad printing: sticker, standard on all cheap keyboards
Figure 22: Example of double shot key. src
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).
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. Below are three different popular key-cap profiles
Figure 25: Keyboard seen from the side. src
Figure 26: Showing DSC, SA, and DSA keycap profiles
4.2. Why Mechanical keyboards?
4.2.1. Membrane keyboard
Rubber membrane, dirt-cheap, key activates at bottom (ouch, can hurt finger joints)
Figure 27: src
4.2.2. Mechanical Keyboard
Each key has its own switch.
Figure 28: src
4.3. Key switches
4.3.1. Mechanical key switch characteristics
Figure 29: 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)
Figure 30: 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
Figure 31: src
4.4. Key Rollover / Ghosting
\(N\)-key rollover = guaranteed to register \(N\) simultaneous keys (NKRO)
Figure 33: src
- A,S,X are pressed simultaneously
- 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-)
Figure 34: 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
Figure 35: src
5.3. Kinesis Advantage (1992)
1997: Contact - Flubber - MIB
Figure 36: Contact
Figure 37: Flubber
Figure 38: 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
Figure 39: Classic Kinesis Advantage
5.5. Ergodox (2011) / Ergodox EZ / Iris / Moonlander
- Open source firmware QMK
- Open source PCB & hardware (3D print or CNC acrylic)
- Many forks, e.g. ErgoDox, Moonlander, Iris
Figure 40: src
5.6. Dactyl
Curved & layout like Kinesis, but split like Ergodox.
Figure 41: Made by Matt Adereth (in Lisp!) of Two Sigma Investments.
5.7. Dactyl Manuform
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 asCtrl+<key>
- tap
- Hold vs. tap, e.g.
- press
ESC
vs. holdESC
, or - tap
SHIFT
vs. holdSHIFT
- press
- For example, with above one can setup parenthesis (or bracket) on shift keys:
- tap
LSHIFT
\(\rightarrow\)(
and - tap
RSHIFT
\(\rightarrow\))
- tap
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:
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)
- The Holy Grail of ergonomic keyboards.
- Company went bankrupt
- Keyboard community over at geekhack is reverse engineering
- Home build: Adjustable, Low-Impact Keeb Is About As Comfortable As It Gets
- or: Squeezebox Keyboard (datahand like)
Figure 47: Oringal DataHand src
Figure 48: DIY build from geekhack src
7. Appendix
7.1. Two great PyCon talks:
- Programming using only microphone: Using Python to Code by Voice
- Programming using stenography: Plover: Thought to Text at 240 WPM
7.2. Other keyboards:
- Atreus (CNC in plywood, or acrylic)
- Keyboardio
- Planck (split)
- DMOTE: Dactyl-ManuForm Opposable Thumb Edition
- Other
7.3. Further reading
- Chyrosran22 - Keyboard reviews; (Vintage) keyboard & key switches review
- Down the mechanical keyboard rabbit hole; blog post
- Mechanical Keyboards 101; An Introduction To The Hobby
7.3.1. Split Keyboard Galleries
- Awesome split keyboards; Photo album of split keyboards
- Split Keyboard Gallery
- Mechkeys; Photo album of split keyboards
7.3.2. Forums
- Geekhack; Forum for keyboard-builds, hacks, ergonomics
- DeskThority; For vintage keyboards, excellent wiki
- /r/MechanicalKeyboards; Reddit
- keychatter;
7.3.3. Keyboard switches
- r/MechanicalKeyboards: Keyboard Switch guides; Extensive guide to keyboard switches
- Beginners guide to key switches; Gives a decent overview of the mechanical keyboard switch community
- /r/MechanicalKeyboards/wiki/switch_suppliers
- Mechanical Keyboard Switches 101 - MX Style 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.
- keyboard-layout-editor.com Plan and design your own keyboard layout
- Designing a Symbol Layer
- Physical Keyboard Layouts Explained In Detail; Keyboard layouts
- Principles for keyboard layouts; Blog post
- Formfactor, 100%, 87% (no numpad), 60%, etc.
- Chyrosran22: Form factors
7.3.5. Build your own
- A Complete Guide to Building a Hand-Wired Keyboard
- [guide] Detailed guide to making a custom keyboard
- Design own PCB: kicad or easyeda
- Firmware: QMK (github) or TMK
- Custom-keyboard plate & case designer: http://builder.swillkb.com doc geekhack-thread
- QMK Basics
- Building my first custom keyboard
- How to build a custom keyboard: an introduction
- How a Key Matrix Work
- Topic: A modern handwiring guide - stronger, cleaner, easier
- Building a custom keyboard from the ground up
- Nick Green: Dactyl Manuform Build Log
- Dactyl Manuform Build Log
- Building my first keyboard (and you can too)
- Let’s Design A Keyboard With Ergogen v4: Introduction
- Sherbet: an ergonomic gaming keypad
- Building a Dactyl Manuform keyboard with hot-swappable sockets
- Handwired Keyboard Build Log - Part 1
- Building A Keyboard - My Dactyl Build Journal
7.3.6. Miscellaneous
- typingclub; Touch-typing trainer
- speedtypingonline.com/typing-test; Keyboard word per minute
- Keyboard tester
- Keyboard N-key rollover test (e.g. press “ASDFJKL”)
- Parametric keycap library (github)
- The effects of split keyboard geometry on upper body postures
- https://ploopy.co - Open, high quality products for your life