Skip to content
Santekno.com | Level Up Your Engineering Skills
EN
📖 0%

What Is a Keyboard? How It Works and the Main Types

· 8 min read ·Ihsan Arif

A keyboard turns each keypress into a code your computer translates using the active layout. Here is how that works, and how keyboards differ by layout, size, switch, and connection.

A computer keyboard is an input device that turns each keypress into a code and sends it to the computer, which then turns that code into a letter, number, or command based on the layout you have selected. The keys look the same on almost every keyboard. What actually separates one from another is four things: the layout, the size, the switches under the keys, and how it connects.

This guide walks through how a keypress becomes a character on screen, then covers each of those four differences, so you can tell what matters before buying one.


What Is a Computer Keyboard?

A keyboard is an input device that converts keypresses into codes for the computer. The computer, not the keyboard, decides which character each code produces.

Keyboards inherited their key arrangement from typewriters, but they work in a completely different way. A typewriter swings a metal arm to strike paper. A keyboard only sends a signal; the character you see is decided entirely in software.

That distinction explains something that surprises a lot of people: the same physical keyboard can type different letters when you change the input language on your computer.

How a Keyboard Works

Underneath the keycaps, every keyboard does the same four things.

MERMAID
flowchart LR
    A["Key pressed"] --> B["Switch closes a circuit<br/>in the key matrix"]
    B --> C["Controller scans the matrix<br/>and detects the key"]
    C --> D["Scancode sent to the computer<br/>(USB HID or Bluetooth)"]
    D --> E["OS maps the scancode<br/>using the active layout"]
    E --> F["Character appears on screen"]
    style A fill:#f0f4ff,stroke:#4f6ef7
    style F fill:#f0f4ff,stroke:#4f6ef7

From keypress to character on screen.

1. The switch closes a circuit. Each key sits on a switch. Pressing it connects two traces on the circuit board. On cheap keyboards, that “switch” is just a rubber dome pushing two layers of conductive plastic together.

2. The controller scans the matrix. Keys are not wired individually. They sit on a grid of rows and columns called the key matrix, and a small microcontroller checks that grid hundreds to thousands of times per second to find which points are connected.

3. A scancode goes to the computer. The controller does not send letters. It sends a code for the key’s position, called a scancode, over USB HID (for wired keyboards and USB receivers) or over Bluetooth.

4. The operating system translates it. Windows, macOS, or Linux turns that scancode into a character using the active layout. That is why the same key produces “Q” on a US layout and “A” on a French one.

Tip
Ghosting and N-key rollover. Because keys share a grid, pressing several at once can confuse the controller into missing keys or registering phantom ones. Keyboards with N-key rollover (NKRO) put a diode on every switch so every simultaneous press is read correctly. You will rarely notice this while typing; in games that hold several keys at once, the difference is real.

Keyboard Types by Layout

The layout decides which letter sits where. Two different things get mixed up here: the order of the letters and the physical shape of the keys.

Letter Arrangement

LayoutWhere it is usedWhat sets it apart
QWERTYMost of the worldThe top row starts Q-W-E-R-T-Y
AZERTYFrance, BelgiumA and Q swapped, Z and W swapped
QWERTZGermany, Austria, Central EuropeY and Z swapped
DvorakPeople who switch for comfortAll vowels on the left-hand home row
ColemakPeople who want efficiency without starting overMoves 17 keys; Ctrl+C/V shortcuts stay put

QWERTY comes from the Sholes and Glidden typewriter of the 1870s. Its odd order is often credited to reducing jammed typebars, though historians still debate how much that mattered. What is certain is that it survived because everyone learned it, not because it is the most efficient arrangement.

Physical Shape: ANSI and ISO

Two QWERTY keyboards can still have differently shaped keys:

  • ANSI (US standard): a wide, horizontal Enter key and a long left Shift.
  • ISO (European standard): a tall, inverted-L Enter key and a shorter left Shift with an extra key beside it.

This matters most when you buy replacement keycaps. An ANSI keycap set will not fully fit an ISO board, and the reverse is also true.

Keyboard Types by Size

Keyboard sizes are usually described as a percentage of a full-size board. The smaller it gets, the more functions move behind a Fn key combination.

SizeApprox. keysWhat is removedGood for
Full size (100%)104 (ANSI) / 105 (ISO)NothingNumber-heavy work: accounting, data entry
96% / 1800about 98–100Gaps between clustersNumpad needed on a smaller desk
TKL (80%)87NumpadGeneral work and gaming; mouse sits closer to center
75%about 84Numpad; navigation compressedDevelopers who still want the F-row
65%about 68F-rowSmall desks, arrow keys kept
60%about 61F-row, arrows, navigationPortable, minimal setups
Split / ergonomicvariesDepends on modelLong typing sessions, sore wrists

The right size depends on your work, not on what is trending. If most of your day is spreadsheets, a full-size or 96% board saves you constant Fn combinations. If you write code and live in shortcuts, 75% keeps the F-row without the width.

Keyboard Types by Switch

The switch under each key decides how typing feels, how loud it is, and how long the keyboard lasts.

TypeHow it worksFeelSoundLifespanPrice
Membrane / rubber domeRubber dome presses two conductive layersSoft, less preciseQuietShortestCheapest
ScissorMembrane with a scissor-shaped stabilizerShort and stableQuietMediumLow
MechanicalIndividual switch with a spring and metal contactsCrisp and consistentDepends on typeTens of millions of pressesMid-range
OpticalPress interrupts a light beam; no metal contactLike mechanicalDepends on typeVery longMid to high
Magnetic (Hall effect)Sensor measures magnet distanceAdjustable actuation pointDepends on typeVery longHigh
Capacitive (Topre)Rubber dome and spring, read by capacitanceSmooth, muted “thock”QuietVery longHigh

Mechanical switches come in three feels:

  • Linear: smooth all the way down, no bump. Popular for gaming.
  • Tactile: a gentle bump when the key actuates, no click. A common choice for typing and coding.
  • Clicky: a bump plus an audible click. Satisfying alone, distracting in a shared office.

Membrane vs Mechanical Keyboards

This is the question most people ask the first time they look at a more expensive keyboard.

MembraneMechanical
ConstructionOne rubber sheet for every keyA separate switch per key
Key feelMushy at the bottom; hard to tell when a key registersThe same from the first key to the last
RepairOne dead key often means a new keyboardSwitches can be replaced, without soldering on hot-swap boards
NoiseQuietLouder, depending on the switch
PriceVery cheapStarts at roughly the price of a nice membrane board

If you type for more than a few hours a day, you will feel the difference within the first week. If the keyboard only sees occasional use, a good membrane board is enough.

Caution
Laptop keyboards are not mechanical. Nearly every laptop uses scissor switches: a membrane design with a scissor-shaped support that keeps short keys stable. A few gaming laptops use low-profile mechanical switches, but they are rare and say so clearly in their specifications.

Keyboard Types by Connection

ConnectionLatencyStrengthsTrade-offs
Wired USBLowestNo battery, no lagA cable on your desk
2.4 GHz wirelessOn par with wired on modern boardsClean desk, responsiveNeeds a USB receiver and charging
BluetoothHigherNo receiver; switches between several devicesCan lag briefly when waking from sleep

Many keyboards now offer all three. That combination is the most practical if you move between a laptop, a desktop, and a tablet.

How to Choose a Keyboard Today

A sensible order of decisions:

  1. Size. Decide whether you need a numpad and an F-row first. It narrows the field more than anything else.
  2. Switch type. Membrane for light use, mechanical for long typing sessions.
  3. Hot-swap. On a mechanical board, swappable switches let the keyboard outlast your preferences.
  4. Connection. Wired if it never moves, multi-mode if you switch devices often.
  5. Physical layout. Match ANSI or ISO to the keycaps that are easy to buy where you live.

If you share an office, choose linear or tactile switches over clicky ones. Your colleagues will notice the difference before you do.

Frequently Asked Questions

Why are QWERTY letters not in alphabetical order? The arrangement comes from 19th-century typewriters. The most common explanation is that it reduced jammed typebars, although the exact reasoning is still debated. It stuck because people learned it, not because it is the most efficient.

Is switching to Dvorak or Colemak worth it? For some people, yes, especially heavy typists with sore hands. Expect weeks of adjustment, and you will still meet QWERTY on everyone else’s computer.

What is a hot-swap keyboard? A mechanical keyboard whose switches can be pulled out and replaced without soldering. Useful when one switch fails or when you want to try a different feel.

Why does a key type the wrong character? Almost always because the operating system’s input language changed, often through an accidental shortcut. Check your keyboard language settings before blaming the hardware.

What does “TKL” mean? Tenkeyless: a keyboard without the numeric keypad on the right, usually 87 keys.

Conclusion

The many types of computer keyboards all do the same job: turn a keypress into a code and let the operating system do the rest. Where they differ is layout, size, switch, and connection, and those four choices decide whether a keyboard fits your hands, your desk, and your work.

Want to understand the other device on your desk? Read computer mouse parts and their functions .

IH
Ihsan Arif
Backend engineer & penulis di Santekno. Aktif menulis tentang Go, Laravel, dan arsitektur backend modern.
Follow

💬 Comments