A keyboard buffer is a section of
computer memory
Memory is the faculty of the mind by which data or information is encoded, stored, and retrieved when needed. It is the retention of information over time for the purpose of influencing future action. If past events could not be remembered ...
used to hold keystrokes before they are processed.
Keyboard buffers have long been used in
command-line
A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive command (computing), commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invokin ...
processing. As a user enters a command, they see it
echoed
In audio signal processing and acoustics, an echo is a reflection of sound that arrives at the listener with a delay after the direct sound. The delay is directly proportional to the distance of the reflecting surface from the source and the li ...
on their
terminal
Terminal may refer to:
Computing Hardware
* Terminal (electronics), a device for joining electrical circuits together
* Terminal (telecommunication), a device communicating over a line
* Computer terminal, a set of primary input and output devic ...
and can edit it before it is processed by the computer.
In
time-sharing
In computing, time-sharing is the sharing of a computing resource among many users at the same time by means of multiprogramming and multi-tasking.DEC Timesharing (1965), by Peter Clark, The DEC Professional, Volume 1, Number 1
Its emergence ...
systems, the location of the buffer depends on whether communications is full-
duplex
Duplex (Latin, 'double') may refer to:
Arts and entertainment
* ''Duplex'' (film), or ''Our House'', a 2003 American black comedy film
* Duplex (band), a Dutch electronic music duo
* Duplex (Norwegian duo)
* Duplex!, a Canadian children's music ...
or half-duplex. In full-duplex systems, keystrokes are transmitted one by one. As the main computer receives each keystroke, it ordinarily appends the character which it represents to the end of the keyboard buffer. The exception is
control character
In computing and telecommunication, a control character or non-printing character (NPC) is a code point (a number) in a character set, that does not represent a written symbol. They are used as in-band signaling to cause effects other than the ...
s, such as "delete" or "backspace" which correct typing mistakes by deleting the character at the end of the buffer.
In half-duplex systems, keystrokes are echoed locally on a
computer terminal
A computer terminal is an electronic or electromechanical hardware device that can be used for entering data into, and transcribing data from, a computer or a computing system. The teletype was an example of an early-day hard-copy terminal a ...
. The user can see the command line on his terminal and edit it before it is transmitted to the main computer. Thus the buffer is local.
On some early
home computers, to minimize the necessary hardware, a
CPU
A central processing unit (CPU), also called a central processor, main processor or just processor, is the electronic circuitry that executes instructions comprising a computer program. The CPU performs basic arithmetic, logic, controlling, an ...
interrupt checked the keyboard's switches for key presses multiple times each second, and recorded the key presses in a keyboard buffer for the operating system or application software to read.
On some systems, if the user presses too many keys at once, the keyboard buffer overflows and will emit a beep from the computer's internal speaker.
Other uses
The use of keyboard buffers is sometimes known from the user experience side as
typeahead
Typeahead is a feature of computers and software (and some typewriters) that enables users to continue typing regardless of program or computer operation—the user may type in whatever speed is desired, and if the receiving software is busy at t ...
.
{{DEFAULTSORT:Keyboard Buffer
Computer keyboards
Computer memory