Keyboard protocol

From Deskthority wiki
Jump to navigation Jump to search

A keyboard protocol defines how a computer and keyboard communicate. Such protocols may be wholly keyboard specific, or they may be a subset or application of a more general-purpose facility such as USB or Apple Desktop Bus (ADB).

The only requirement is that a keyboard be able to inform the computer of keystrokes. This was the limit of the XT keyboard interface. When IBM added status lights to the IBM Model F keyboard for the lock keys, it became useful for the computer to talk to the keyboard, so that it could switch the status lights on and off. This allows the the BIOS to choose whether num lock is enabled or disabled at boot, and for software to disable caps lock by ignoring it (since the computer chooses whether the light comes on). It was possible with PS/2 keyboards to control the lights directly, for use as general purpose status indicators; supposedly with USB it is completely impossible to change the lights independently of the keyboard status, but remote control software such as LogMeIn Rescue can get the keyboard and indicator status out of sync on a USB keyboard. For years, Apple indicated lock status using a latching action key, meaning that the computer had no influence on whether or not caps lock was engaged.

Some protocols alert the computer when keystrokes occur; this is the case with PS/2. With USB keyboards, control has been handed to the computer, which periodically checks with the keyboard to see which keys are being held (normally 100 times per second). This is the basis of why PS/2 has inherent N-key rollover (since it notifies the computer one key at a time), while USB by default can only respond with a list of up to six keys being held (plus modifiers). NKRO over USB is possible, but many keyboards limit themselves to 6KRO (e.g. Filco Majestouch, which is NKRO using a USB-to-PS/2 adapter) or a similarly low number such as 10KRO (e.g. Matias Tactile Pro 4). (Of course, pressing more than ten keys simultaneously for a human would be an interesting feat.)

Protocols and connectors

Keyboard protocols are distinct from the connectors used to attach keyboards to computers. The PS/2 interface is simply a decision taken by IBM to use the AT keyboard interface for mice in addition to keyboards, with a reduction in plug size from 5-pin DIN to 6-pin mini-DIN. A simple adapter can be used to change between the larger and smaller plugs. AT keyboards however re-used the same plug as XT keyboards, necessitating a physical switch on the keyboard to tell the keyboard controller which protocol to use.

The use of an unusual connector on a keyboard, especially those with a removable cable (e.g. SDL connector or modular connector) does not indicate anything about the protocol that the keyboard speaks. The keyboard may speak a well-understood protocol such as AT, ADB or XT, or it might use a proprietary protocol specific to the computer series.

See also