A keyboard wedge is an interface which allows a non-keyboard device to plug into a computer as though it were sending keyboard data. Since most data-entry software is set up to take data from a keyboard, it is necessary to use a keyboard wedge if you want to plug in a peripheral such as a barcode scanner or magnetic strip reader and have it send information to the program. The wedge is so called because the physical version "wedges" between the keyboard and the computer. The keyboard is plugged into the wedge, which in turn is plugged into the computer, so that data may be inputted through either the keyboard or the other peripheral.
Software versions of the keyboard wedge exist as well. These programs take information that is sent by the external input device, usually plugged in through either a COM or USB port, and send them through the keyboard buffer of the operating system, so that the computer thinks the information has been sent in via keyboard.
A keyboard wedge can be useful when using software with a peripheral that the software was not intended for. While some data-entry software is written specifically with barcode scanners or magnetic strip readers in mind, the majority is written assuming a keyboard will be the only device used to input data. For efficiency, however, many businesses use barcodes instead of manually inputting the unit code, and since most humans don't read barcodes, some method of translating the barcode into its constituent information and passing it to the computer as alphanumeric data was needed. The keyboard wedge was developed in the early days of computing, by a programmer at Altek Instruments in Britain.
Older keyboard wedges are built to interface with a computer via a PS/2 port, as this is the traditional keyboard port. Newer versions usually offer an interface for both a PS/2 cable and a USB cable, as USB keyboards become more and more standard. Some wedges are built to interface with proprietary ports such as IBM's Port 17 or OCIA. This type of keyboard wedge is increasingly difficult to find, but small companies still exist to fill the niche.