The PS/2 interface is a serial keyboard and mouse interface developed by IBM for their PS/2 line of computers. The physical connector is a 6-pin mini-DIN, with four of the pins connected.
Computers generally came with two PS/2 ports, one for the keyboard, and the other for the mouse. The ports were separately marked, as computers required the correct device to be inserted into each socket. Connecting a keyboard into the mouse port, or vice versa, will traditionally not work; an IBM PS/2 computer will hang on boot with a cryptic number displayed on the screen if the keyboard is mistakenly connected to the mouse port. Contrast this with with Apple Desktop Bus, which was a daisy chain bus that accepted devices in any order. Modern laptops however tend to feature a single PS/2 port that can be used by either type of device.
To avoid confusion in identifying the ports, the first version of the PC System Design Guide in 1997 specified that mouse and keyboard ports would be coloured purple and green (specifically, mauve and green) for keyboard and mouse respectively.
PS/2 ports are not hot-swappable. Connecting a keyboard or mouse to a running machine can cause damage to some motherboards and/or some older operating systems to hang.
The PS/2 keyboard connection uses the same keyboard protocol as the AT keyboard interface.
On the IBM RS/6000, the two pins not used by the PS/2 protocol connect to a speaker inside the IBM Model M Enhanced Keyboard that systems came with.
For mice, IBM introduced a new protocol very similar to the AT interface. This replaced serial mice and older mouse connections.
The PS/2 port is typically associated with the IBM PS/2 and PC clones. However, many Macintosh clones from the late 1990s also featured PS/2 mouse and keyboard ports. One advantage of this arrangement was that you could connect a two-button PC mouse to the computer and use a program such as TheMouse2B to map the second button to control+click, thereby achieving contextual menus from the right button as with a Windows computer. Shortly after the demise of the Macintosh clone industry, Apple introduced the iMac, which featured USB ports for the mouse and keyboard; this was followed three years later with Mac OS X, with native support for multiple mouse buttons and right-click contextual menu activation.