How a Computer Works

How Computer Input and Output Work

Trace the A key from its switch to a letter on the screen. Add Shift and watch which pixels change as a lowercase a becomes a capital A.

Read the steps

  1. Close the A key switch

    Pressing the key closes an electrical contact. Shift is a separate key. Neither switch sends a letter directly.

  2. Scan the keyboard matrix

    A controller drives one row and reads the columns. The closed A switch connects row 2 to column 1 in this illustrative matrix; debouncing rejects contact chatter.

  3. Send a USB report

    The boot-keyboard report carries usage 0x04 for the A key. Left Shift changes the modifier byte to 0x02; the usage stays 0x04.

  4. Let software choose the character

    With a US English layout and Caps Lock off, the same key usage becomes a or A depending on Shift. The application stores the character.

  5. Draw the glyph into a framebuffer

    Font drawing turns the character into coloured pixels. This lesson uses the same 8 × 8 framebuffer model as the graphics chapter. The selected top-centre glyph sample differs between a and A.

  6. Address an LCD subpixel

    The row gate turns on a thin-film transistor (TFT). The column driver charges a storage capacitor to the selected pixel voltage. The TFT then isolates that voltage until the next refresh.

  7. Control transmitted light

    The electric field changes the liquid crystal orientation. Together with polarisers, it changes how much backlight passes through a colour filter. The TFT controls voltage; it does not make light.

  8. See the typed character

    The screen presents the stored glyph. Releasing the keys sends an empty report and leaves the character on screen. Try Shift with A and follow the changed modifier, character, framebuffer sample, stored voltage and light.