PIA
The Peripheral Interface Adapter is a chip, of which there are two in your CoCo, that is used for handling I/O, amongst other things.
Keyboard
The keyboard can be scanned through PIA-1 by pulling two values from addresses $FF00 and $FF02. Color Basic ROM, when running a prompt, converts these to ASCII values to be printed to the screen at cursor position. The first address ($FF00) represents the keyboard rows as well as the joystick button, and the second address ($FF02) the keyboard columns. These two value correspond to ASCII values according to the following table:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | |
| 0 | ||||||||
| 1 | ||||||||
| 2 | ||||||||
| 3 | ||||||||
| 4 | ||||||||
| 5 | ||||||||
| 6 | ||||||||
| 7 |
(under construction)