BIOS, it manages inputs and outputs. Usually the decoding of the signals from the keys are done in the keyboard itself. They have a chip that does the work internally. That goes for gaming keyboard (to reduce lag in the computer), Wireless keyboards (mostly Logitech ones, the dongle that connects to your USB port decodes it itself), and others, check if they have a decoder/compressor/parser chip inside, close to where the wire exits.