A computer includes a key input unit having both cursor keys and a mouse mechanism, a keyboard having a holding section for detachably holding the key input unit, and a connector which electrically connects the key input unit and the keyboard together when the key input unit is held in the holding section of the keyboard. The computer further includes a signal transmitter which transmits a signal from the key input unit to the keyboard when the key input unit is removed from the holding section of the keyboard. The signal transmitter is made up of a light-emitting section and a light-receiving section. The light-emitting section is provided for the key input unit, and converts a signal entered from the key input unit into an optical signal and emits this optical signal. The light-receiving section is provided for the keyboard, and receives the optical signal emitted from the light-emitting section and converts the optical signal into an electric signal. Through the light-emitting section and light-receiving section, a signal entered from the key input unit is transmitted to the keyboard.