Curious Minds

Clear answers to science and history questions

How Mechanical Keyboards Work: A Detailed Guide

· 7 min read · Science

Mechanical keyboards work by using individual mechanical switches under each keycap that complete an electrical circuit when pressed, sending a signal to the computer—unlike membrane keyboards that rely on pressure on a continuous rubber dome or conductive layer.

Historical Background

Mechanical keyboards trace their origins to early electromechanical typewriters and teletype machines in the mid-20th century. The first true mechanical keyboards appeared alongside mainframe computers in the 1960s and 1970s, where durability and reliability were paramount. IBM’s Model M, introduced in 1984, became a benchmark for quality and is still revered today for its buckling spring mechanism. As personal computing expanded, cost pressures led manufacturers to adopt cheaper membrane and scissor-switch designs, especially for laptops and budget desktop keyboards. However, the core mechanical switch remained the standard for professionals, typists, and gamers who valued tactile feedback and longevity.

Core Components and Their Functions

A mechanical keyboard consists of several key elements working in concert:

  • Keycaps: The visible, removable top layer, typically made of ABS or PBT plastic, that the user presses.
  • Switches: The heart of the system—each key has its own switch that detects depression and triggers a signal.
  • PCB (Printed Circuit Board): A board with copper traces that connect switches in a matrix; pressing a key closes a specific circuit.
  • Controller/Microcontroller: A small chip on the PCB that scans the matrix, interprets key presses, and communicates with the computer via USB or wireless protocols.
  • Plate: A rigid layer (usually steel or aluminum) that holds the switches in precise alignment.
  • Case: The outer shell, often plastic or metal, providing structural support and aesthetic appeal.

How Mechanical Switches Work

Inside each switch is a spring, a metal contact, and a moving stem. When a key is pressed, the stem moves downward, compressing the spring. At a certain point—determined by the switch design—the stem’s internal contact bridges two electrical contacts on the PCB, completing a circuit. The controller detects this closure, registers the key press, and sends the corresponding data to the host computer. The spring then returns the stem to its original position when the key is released.

Switches are categorized by their actuation type:

  • Linear: Smooth, consistent keystroke with no tactile bump or audible click (e.g., Cherry MX Red).
  • Tactile: Features a noticeable bump during travel to signal actuation without a loud sound (e.g., Cherry MX Brown).
  • Clicky: Combines a tactile bump with an audible click caused by an internal clicker mechanism (e.g., Cherry MX Blue).

Switch Matrix Scanning

Instead of wiring each switch directly to the controller (which would require 100+ wires for a full-size keyboard), mechanical keyboards use a matrix configuration. Rows and columns of traces are laid out on the PCB, with each switch at an intersection. When a key is pressed, it connects a specific row to a specific column. The controller rapidly scans rows by applying voltage one at a time and reading which columns detect that voltage—identifying the key location.

This scanning happens hundreds of times per second, allowing fast response. However, it introduces a limitation called ghosting: if three keys are pressed simultaneously (e.g., in a corner of the keyboard), the controller may misread the combination as a fourth key press at the intersection of the same row and column. Modern keyboards solve this with diodes (one per switch) that prevent reverse current flow, ensuring only the actual pressed keys register—a feature known as N-key rollover (NKRO) when combined with proper USB communication.

How to Choose a Mechanical Keyboard

Selecting a mechanical keyboard depends on use case, preference, and environment. Consider these factors:

  1. Switch type: Choose linear for gaming (fast, quiet), tactile for balanced typing, clicky for feedback (but noisy in offices).
  2. Size and layout: Full-size includes a numpad and function row; tenkeyless (TKL) omits the numpad; 60% removes arrow keys and function row for compactness; 40% removes almost everything except letter keys.
  3. Build quality: Look for stainless steel or aluminum plates for rigidity, and PBT keycaps for durability and resistance to shine.
  4. Connectivity: Wired USB-C offers lowest latency; wireless adds convenience but may sacrifice some responsiveness or battery life.
  5. Customizability: Removable keycaps, hot-swappable sockets (for switching switches without soldering), and programmable keys enhance longevity and personalization.

Common Problems and Fixes

Even well-built mechanical keyboards can develop issues:

  • Sticky keys: Often due to debris under the keycap or dried lubricant on the switch stem. Clean with compressed air or isopropyl alcohol and a switch lubing kit.
  • Unresponsive keys: May indicate a broken switch, loose solder joint, or damaged PCB trace. Testing with software like Keyboard Tester can isolate hardware vs. firmware issues.
  • Double typing: Caused by overly sensitive switches or mechanical defects like a cracked spring. Replacing the switch (if hot-swappable) or adjusting actuation force settings in firmware can help.
  • Ghosting or missed presses: Usually resolved by enabling NKRO in BIOS/OS or using a keyboard with built-in diode protection.

Comparison to Other Keyboard Types

Mechanical keyboards differ significantly from alternatives:

  • Membrane keyboards: Use a rubber dome under a continuous conductive layer; pressing a key pushes the dome to touch a lower layer, completing the circuit. They’re quieter and cheaper but lack tactile precision and wear out faster (typically 5–10 million keystrokes vs. 50–100+ million for mechanical).
  • Scissor-switch keyboards: Used in laptops and ultra-thin keyboards; a scissor-like mechanism stabilizes the key and shortens travel distance. They offer more feedback than membrane but less than mechanical, and durability is moderate (~10 million keystrokes).
  • Electrostatic capacitive keyboards: High-end alternatives (e.g., IBM Model F) that detect changes in capacitance rather than physical contact. They’re extremely durable and smooth but rare and expensive.

Cost Considerations and Value

Prices range widely: basic prebuilt keyboards start at $30–$50, while premium models with custom keycaps, aluminum cases, and features like hot-swap sockets can exceed $200. DIY kits (without switches or keycaps) begin around $60. Though more expensive upfront, mechanical keyboards often last decades—reducing long-term cost per year of use. Many users report lower hand fatigue and improved typing accuracy over time, contributing to perceived value.

Safety and Maintenance

Mechanical keyboards are generally safe, but proper care prevents issues:

  • Never spill liquids: Most keyboards lack IP ratings for liquid resistance. If liquid is spilled, unplug immediately, invert the keyboard, and let it dry for 48+ hours before reuse.
  • Cleaning frequency: Remove keycaps monthly and wipe plates with a microfiber cloth; deep clean every 6–12 months depending on environment.
  • Switch lubrication: Can improve smoothness and reduce noise but requires care—over-lubing may cause inconsistent actuation or dust buildup.
  • ESD protection: While rare, static discharge can damage the controller. Ground yourself before handling internal components in DIY builds.

Frequently Asked Questions

Do mechanical keyboards really last longer?

Yes. Most mechanical switches are rated for 50–100 million keystrokes, far exceeding membrane (5–10 million) or scissor-switch (10 million) keyboards. A 2022 study by a major keyboard manufacturer found that over 70% of mechanical keyboards built before 2005 remained functional with regular use—though switch lubrication and cleaning significantly extend this lifespan.

Can you use any keycaps on any mechanical keyboard?

No. Keycap compatibility depends on the switch stem type (e.g., Cherry MX, Alps, Kailh), keycap profile (e.g., OEM, SA, DSA), and keyboard layout. Cherry MX-compatible stems are standard, but some proprietary switches (e.g., older Logitech or Microsoft) have non-standard stems. Also, low-profile keyboards require specially designed keycaps.

Are mechanical keyboards louder?

Clicky switches (like Cherry MX Blue) produce an audible click with every press, making them noticeably louder than linear or tactile switches—and far louder than membrane keyboards. However, linear switches (e.g., MX Red) and tactile ones (e.g., MX Brown) can be as quiet as or quieter than membrane keyboards, especially when paired with sound-dampening mods like foam padding or O-rings.

Do I need to lubes switches?

Lubrication is optional. It smooths keystrokes, reduces scratchiness, and dampens noise—but it’s not required for function. Many users prefer the stock feel. Lubing is only recommended for enthusiasts comfortable disassembling switches; improper application can attract dust or cause inconsistent travel. Pre-lubed switches (e.g., Gateron Red Pro) are available for beginners.

Can mechanical keyboards work with gaming consoles or phones?

Yes, but with limitations. Many support basic USB HID functionality, so they’ll work with PlayStation, Xbox, or Android devices for text input or menu navigation. However, advanced features like macros, RGB lighting, and NKRO may not be recognized without firmware support. Some keyboards have dedicated console modes or require third-party software on a computer acting as a bridge.

What’s the difference between hot-swap and soldered switches?

Hot-swap keyboards have sockets (usually Kailh hot-swap sockets) soldered to the PCB, allowing switches to be plugged/unplugged without soldering. Soldered keyboards require desoldering to replace switches, which risks damaging the PCB if done incorrectly. Hot-swap adds cost but enables experimentation and repair; soldered builds are more reliable long-term if assembled correctly.

In this article
  1. Historical Background
  2. Core Components and Their Functions
  3. How Mechanical Switches Work
  4. Switch Matrix Scanning
  5. How to Choose a Mechanical Keyboard
  6. Common Problems and Fixes
  7. Comparison to Other Keyboard Types
  8. Cost Considerations and Value
  9. Safety and Maintenance
  10. Frequently Asked Questions