How does a Computer Keyboard Work?

A keyboard is a device, attached to your computer, either directly to a communication port or a USB port, that produces output through its keystrokes. Each key or button, combined with the pressing of other keys and buttons simultaneously, produces a unique value that is then transmitted to the operating system so that software or programs can then assign a task to perform.