Mechanical Keyboards

Hardware
Keyboard
Published

March 13, 2023

Modified

April 4, 2023

65% mechanical keyboard with English ANSI/QUERTY layout

Keyboards …primary input device for computers

How does is work…

Keyboard…

  • …control circuitry …convert key presses into scancodes
  • Constantly scans all switches for a keystroke
    • …keystroke …user closing a contact by pressing a switch
    • …typical switches settles within 5 milliseconds (into firm contact)
    • …mechanical vibration effect is called bounce
    • …key release bounces again (…reverted to no-contact state)

Keyboard controller…

  • …produces single scancode …compensating bounce effect
  • Called debounce of a keystroke…
    • …aggregates over time …produce one “confirmed” keystroke
    • …down code at key press …up code at key release independent
  • Sends the scancode to the keyboard driver …on the connected host
    • …maps scancodes to keycodes
    • …keyboard layout maps a keycode to a symbol or keysym
    • …symbol mapping depends on holding a modifier keys
    • …mapping scancodes to keycodes is universal (not application specific)

Capacitive vs Mechanical

Today most keyboards in use are capacitive.

  • Capacitive keyboards…
    • …rubber dome over a membrane as contact sheet
    • …does not physically complete a circuit on key press
    • …designed to be cheap an easy to produce
    • …light “squishy” and quiet typing experience
    • …rated at 1-10 million key strokes
  • Mechanical keyboards…
    • …mechanical mechanism (key switch) to record a key stroke
    • Most users agree…
      • …different level of audible and tactile response
      • …superior typing feedback
      • …more comfortable …enjoyable typing experience
      • …better precision in gaming
    • …designed for quality and customization
    • …more durable 20-100 million key strokes

Connection

Several ways are supported to connect a keyboard to a computer…

  • Using cables…
    • PS/2 (6-pin mini-DIN connector)
      • …IBM compatible PCs (1987)
      • …replaced by USB
      • …USB to PS/2 adapters exist
    • USB
      • …standard for cabled keyboards
      • …USB-C replacing USB-A (in recent years)
  • Wireless connections…
    • …increasingly popular
    • …USB dongles …supported for radio frequency (RF) or infrared (IR)
    • Bluetooth became standard (in recent years)

Keys

Most computer keyboards contain at least following keys:

  • Character keys, core section of the keyboard
    • Three rows for typing letters a-z and punctuation []{};':",./<>?\|
    • Upper row for typing digits 1234567890 and special symbols ~!@#$%^&*()_+-=
    • The bottom row includes a Space bar to enter a space
  • Modifier keys change the function of other keys
    • Shift alter the output of character keys (i.e. capitalize)
    • Ctrl (control) and Alt (alternate) trigger special functions
    • Alt Gr (graph) secondary shift key (in place of the right Alt key)
    • Caps Lock used as toggle key permanently enable Shift
    • Modifier keys are typically used together with other keys
  • Navigation Keys
    • Arrow Keys to navigate with the text cursor
    • Page Up/Down used to scroll up or down in documents
    • Home and End used to return to the beginning/end of the document
  • Function keys F1 up to F12
  • Dead keys special modifier keys not generating a character itself
    • Pressed an released before other keys to modify the subsequent key press
    • I.e. to type letters with grave accent like à
  • Compose key is a generic dead key
    • Allows interpreting whole sequences of keystrokes
    • I.e. to type acute accent á using ' (apostrophe)

Home row keys…

  • …row on the keyboard the fingers rest on when not typing
  • …thumb rests on the space bar.
  • …this position increases typing speed and accuracy

Sizes

Picking a size is the first crucial step of selecting a keyboard…

  • Full-size, 100%, 104/105 keys
    • Alphanumeric keys
    • Arrow keys (navigation cluster)
    • Function keys (F-row)
    • Number pad
  • 96-key
    • All 100% keyboard keys
    • More compact form factor
    • No space between the different key clusters
  • Ten-key-less (TKL)
    • 80% off a full size keyboard
    • Does not have a number pad
  • 75%, ~84 keys
    • No number pad
    • Arrow keys
    • Function keys
    • Some control keys
    • More compact form factor then TKL
  • 65%, ~65 keys
    • No number pad
    • No function keys
    • Arrow keys
    • Some control keys (PgUp, PgDn, Ins, Del)
  • 60%, ~61 keys
    • No number pad
    • No function keys
    • No arrow keys
  • 40% …like 60% …no numeric keys

Typically missing keys are available on a different layer accessed by an “Fn” function key

Take a look to – The Different Keyboard Sizes Explained

Physical Layout

Actual positioning of keys on a keyboard

ANSI & ISO

ANSI and ISO keyboards differ in size and orientation of some keys

  • ANSI (common in the USA)
    • …104 keys (full-size), 87 keys for TKL
    • …rectangular enter key
    • …Backslash above enter key
    • …Shift keys have the same size
    • …frequently used enter key and left shift closer to the home row
  • ISO
    • …105 keys (full size), 88 keys for TKL
    • …Enter key is a upside-down L-shape
    • …Backslash left of enter key
    • …left shift 50% smaller
    • …right Alt key replaced by Alt Gr key
  • ANSI is considered more ergonomic then ISO in some details

Ortholinear vs Staggered

Differ in the alignment of keys…

  • Staggered …keys form a diagonal pattern
    • …most widely used keyboard layout
    • …inherited from the design of the vintage typewriter
  • Ortholinear …keys are consistently and straightly aligned
    • …keyboard that aligns in a columnar manner …uniform grid
    • …recommended for professional typists …prolonged hours of typing
    • …minimizes finger movement …less straining on the fingers
    • …most are 40% keyboards
      • …modifier keys have small key-caps
      • …easier to carry and travel
  • Column-staggered
    • …columns are straight, but rows are not
    • …rows form a roof shape to adjust to finger length
  • References…

Ergonomic & Split

Physical layout to improve ergonomics

  • …more flexibility for positioning …can be both..
    • tilted …front part raised
    • tented …halves raised with their backs turned from one another
    • …helps to achieve a more neutral position …aligned forearms …more relaxed muscles
  • …improves posture of shoulders, elbows and writs
  • …avoid injuries such as Carpal Tunnel Syndrome
  • …unusual layout…
    • …requires adjustment period
    • …forced to use left and right hands in their respective regions

Ergonomic keyboards have a single board (PCB)…

  • …separated into two halves …aligned in a wingspan-shaped form
  • …hand position reduces strain on the wrist

Layout called Alice or Arisu (includes the arrow keys in addition)

Split keyboards are variation (continued development) of ergonomic keyboard…

One distance from home principle…

  • …layout of a keyboard with 36 keys
  • …each key is adjacent to the home row and thumb fan

Functional Layouts

Key-meaning association …arrangement of letters and symbols on keys

  • …visual legends on keys …characters engraved on a key-caps surface
  • …aka keyboard mapping …determined in software/firmware …actual response to a key press

QWERTY and QWERTZ

Standard keyboard layouts (Latin-script alphabets)…

  • …original design of this layout created for the mechanical typewriters (1866)
  • …variants for different languages like QWERTY English or QWERTZ German
  • QWERTY layout considered the most practical for programming
    • …since the positioning of many frequently used symbols is more ergonomic
    • …in particular for pipe | and backslash /, punctuation ;,.: and braces {}[]<>

Non-QWERTY

Alternatives to improve input efficiency

  • …different location of common letters …home row, bottom row, and top row
  • …improve ergonomic to prevent typing injury…Repetitive Strain Injury (RSI) and tendonitis

Following are optimized for the English language …not valuable for other languages

  • Dvorak (1930)
    • …designed for more effective typing of common letters over
    • …goal is to minimize finger movement compared to QWERTY
    • …most used letters positioned on the home row AOEU-HTNS
  • US Colemak (2006) – https://colemak.com
    • …layout of the common letters improved over QWERTY (idea inherited from Dvorak)
    • …continues to improve letter positions over Dvorak …home row ARST-NEIO
    • …Ctrl-ZXCV (shot cuts for copy-paste) inherited from QWERTY
    • …punctuation ;,.: and braces {}[]<> the same like QWERTY
  • Workman (2010) – https://workmanlayout.org
    • …continues to improve over Colemak
    • …considers frequently used bigrams like HE of English language
    • …minimize side-to-side movements …prefer up-down motion
    • …optimizes letter rows to minimize strain on fingers …minimal use of middle columns
  • Others…

Components

“feel” of a keyboard varies depending on…

  • …keyboard case …hold everything together
    • …size, material, aesthetic
    • …construction …sturdiness
    • …ergonomics (angel, tilt)
  • …(printed) circuit board (PCB)
    • …determines the size, features, and layout
    • …firmware …programmability
  • …switch mount construction
  • …switch types (force, feedback)
  • …switch keycap stabilizers
  • …keycap construction (shape, size)
  • …keycap print (readability)

List above …by no means exhaustive

Switch opener (1); switch components: upper housing (2), stem (3), spring (4), bottom housing (5); assembled hot-swap switch (6); key-caps top and bottom (7); switch puller (8), key cap puller (9)

Enthusiast keyboard community…

  • …community of people extensively customizing mechanical keyboards is quickly growing
  • …many manufacturer provide a constantly expanding list of components to facilitate this trend
  • Mechanical keyboards are more durable
    • easier to clean since they allow disassembly
    • …individual components replaceable on defect (in particular switches)

Keycaps

Plastic top cap with the letter printing …mounted on the switch stem

Main benefits are the aesthetics…

  • …component the user interacts with the most
  • …selection of specific keycaps entirely subjective
  • Customization…
    • …materials and shapes influence the “feel”
    • …thickness and rigidity influence the sound

Material used for keycaps…

  • ABS (Acrylonitrile Butadiene Styrene)
    • …cheapest and most common plastic
    • …mass produced by injection molding
    • …feel smooth, wear down (greasy shine over time)
    • …quieter sound (when typing)
  • PBT (Polybutylene Terephthalate)
    • …more expensive
    • …higher quality (thicker/brittle), more durable
    • …textured feel, matte
    • …louder sound (when typing)
  • …others exists like metal or glass

Backlighting key caps…

  • …more complicated manufacturing, uses two separate plastics
  • Doubleshot …lighting can shine through the legends
  • Pudding …light can also shine through the sides of the keycaps

Overall shape/profile of the keycap…

  • Uniform keycaps have a flat surface and no angled at all
  • Sculpted keycaps have a slight angle to help with typing
  • …the most recommend profile for typing is Cherry

References…

Switches

Mechanical switches: left an MX-style switch from Gateron, right a low-profile Choc V1 switch from Kailh. These are not only of different height, but have completely incompatible geometry. Different stem connectors for the keycaps and non-compatible leads for PCB connection on the bottom.

Linear, Tactile and Clicky

Determines how typing feels and sounds …broadly divided into three categories

  • Linear (i.e. Cherry MX Red)
    • …recommended for a quieter environment
    • …consistent (straight-down), smooth key press
    • …no tactile feedback (bump)
    • …no audible click noise
    • …more rapid actuation
    • …resistance increases in a linear fashion along the travel of the key
  • Tactile (i.e. Cherry MX Brown)
    • …more ergonomic and fluid typing experience
    • …tactile feedback, noticeable bump in the middle of travel
    • …bump is located at the point of actuation, where a key press is registered
    • …indication of a press without needing to bottom out your keys
    • …bottom out …when the switches are depressed all the way down
  • Clicky (i.e. Cherry MX Blue)
    • …like a tactile switch
    • …distinct “click” sound when the key is activated
  • Switch database – https://switches.mx

Characteristics

Beside the sound and feel following are some more differentiating characteristics

  • Operation Force (measured in centinewton (cN) or gram-force (gf))
    • Light 0-55 cN
    • Medium 55-75 cN
    • Heavy 75-95 cN
    • Super Heavy 95+ cN
  • Actuation Point (measured in millimeters)
    • Point where a keypress is recognized by the keyboard
    • Typically 1.1 - 2.5 mm
  • Travel Distance (measured in millimeters)
    • Distance until the key press reaches the bottom
    • Typically 3.5 - 4 mm
  • Reset Point - Distance at which the key is deactivated when released
  • Durability (measured in number of key presses)
    • 50 - 80 million for metal contact
    • more then 100 million for optical

Hot-swappable & Soldered

Depending on the PCB…

  • …possible to solder surface mounted hot-swap connectors to the bottom
  • …these connectors support swapping the switches without the requirement of soldering
  • …note that different switch geometries require different hot-swap connectors

Many keyboard vendors support hot-swap of MX-style switches and often include additional spare switches and sometimes keycaps.

Bottom side of a PCB supporting hot-swap connectors (K12, K13, etc) soldered to the surface. At the same time thru-hole soldering for the switch leads is supported turning the switch 180° around.

DIY kits typically support…

  • …multiple types of switch footprints (not necessarily on a single PCB)
  • …hot-swap and direct soldering of switches (supported by the same PCB)
  • daprice/keyswitches.pretty repository on GitHub…
    • …provides a comprehensive overview of the PCB footprints for switch sockets
    • …supports both MX-style and Choc switches for KiCAD

Stabilizers

Stabilizers determine how the larger keys will feel and sound when pressed.

  • Helps prevent larger keys from wobbling
  • Allows your spacebar to make the perfect “thock” sound

Different mounting styles:

  • Plate-mounted …pre-build keyboards
  • Snap-in
  • Screw-in …considered the best

Depends mostly on PCB/plate compatibility

Board (PCB)

Keyboard with removed keycaps and removed hot-swap switch. The switch socket is compatible with all types of switches. The LED sits on the bottom, so called south-facing.

Most important component of a keyboard

  • …lets the switches communicate with your computer
  • …determines the size, features and layout
    • flippable boards have mirrored front and back-sides …both sides of a split keyboard have the same PCB
  • Ergogen software used to design keyboard PCB layouts
    • source code available on GitHub
    • …generates CAD files from the design
    • …exported to KiCAD for routing of the connections

Switch connection types…

  • Soldered
    • …standard in mass production
    • …custom through-hole PCBs exist
  • Hot-swappable …no soldering
    • ..hot-swap connector on the bottom of the PCB
    • …switches pressed into PCB …switch puller used to remove

Printable cases… – 40% keyboardArke

Microcontroller (MCU)

Pro Micro (5V/16MHz) is the most widely used controller for hand-wired and other custom mechanical keyboard builds

  • …generally a MCU with support for community supported firmware is preferable
  • …for example a list of QMK compatible microcontrollers
  • Other MCU options are…

Socketing a microcontroller …socketed controllers can be removed easily

  • …micro controllers easily damages during use …in particular the USB port
  • …more expensive controllers will eventually be reused in new projects
  • …de-soldering a microcontroller is a lot of work …can damage the controller accidentally
  • …a prominent option are Mill Max low-profile IC sockets
  • Pins
    • …socketing can be done with diode legs …requires manual cutting
    • …or Mill Max socket pins …premade to the right size …more rigid material (no pin-bending)
  • How do I socket a microcontroller?

Modifications

Include…

  • …changes to aesthetics
  • …changes to the haptics …ergonomics
  • …changes to the keyboard sound profile
    • …rattling stabilizers
    • …silent switches …lube …o-rings
    • …case dampener

Foam Mod

Sandwiched foam in between plate and PCB…

  • …improved sound-dampening
    • …limit frequency ranges heard when typing
    • …“poppy” or “creamy” sound
  • vibration-dampening
    • …slightly better and more premium typing experience
    • …achieve a softer feel with keystroke
  • …foam acts as cushion for the switches

Materials …width 0.5mm …anti-static …non-conductive

  • PE (Polyethylene) …thermoplastic
    • …thin foam made of plastic …known as packing sheet
    • …meant to reflect sound back
    • …flatten the sound signature
  • EVA …mute the sound profile by absorbing sound waves
  • Foam stickers…
    • …switch pads …PCB stickers
      • …adhesive-backed foam square
      • …applied directly to the PCB
    • switch tripods
      • …triangular foam ring
      • …applied to the bottom of switches

References…

Tape Mod

…tempest mod …tape the bottom of the PCB

  • …deeper and richer sound
    • …mid to high frequencies from PCB absorbed
    • …only reflecting back lower frequencies
  • …“thock” or “clack” sound

Material…

  • …that is…
    • …not too adhesive or sticky
    • …designed to be easily removed
    • …not conducive
  • …masking …painter’s tapes

Lubing Switches

Lubricate switch housing and stem of MX style switches…

  • …typically done on linear and tactile switches (not clicky switches)
  • …improve smoothness “feel” when typing …lessen switch noise
  • …amount …areas to be lubed depends on switch type

Switch opener …specialized devices designed to open up switches

O-Rings

O-shaped rings …silicone or rubber

  • …place inside keys …by removing key-caps
  • …absorb force from key contact (bottom-out)

Holee Mod & Wire Balancing

Modding of stock stabilizers…

  • …thin strip of adhesive into the second hole of the stabilizer stem
    • …dampened contact point …between wire and stabilizer stem
    • …minimizing rattling noise

Make stabilizer wires as straight as possible

  • …check on the evenness
    • …wire on top of a flat surface
    • …pressing down one end …lightly tapping the other
    • …end you tap lifts up …unevenness

Firmware & Software

Keyboard controller firmware commonly supported on custom PCBs…

Key remapping…

References

Typing practice – https://www.keybr.comhttps://monkeytype.comhttps://www.speedcoder.net

Community

Youtube…

Articles…

Community…

Manufacturers & Shops

Manufacturers…

Shops…