The very first keyboards were not attached to the computers, but punched holes in paper cards which were later fed to the computer. A wire sensor was an open circuit where there was no hole, and a closed circuit where there was a hole, as the card passed through the computer's card reader. The keyboard driven keypunch machine actually predates the computer.
Demonstration of an advanced late-model keypunch machine:
Summary from the Source of All Knowledge*:
The keypunch machine is a typewriter for punchcards, essentially.
Over time, there have been punchcards where the holes represented all different kinds of data, but the most common punchcards in the computer era
could represent letters, numbers, a little punctuation and a few mathematical symbols. They were used to write Fortran and Cobol programs and data
for those programs, among other things.
The symbol printed at the top of each column shows what the column encodes here.