{Begin Chapter Terminal Input/Output}
{Title Terminal Input/Output}
{Text

{Index *PRIMARY* Terminal input/output}

Most input/output operations in Interlisp can be simply modeled as reading or writing on a linear stream of bytes.  However, the situation is much more complex when it comes to controlling the user's "terminal," which includes the keyboard, the mouse, and the display screen.  For example, Interlisp coordinates the operation of these separate I/O devices so that the cursor on the screen moves as the mouse moves, and any characters typed by the user appear in the window currently containing a flashing cursor.  Most of the time, this system works correctly without need for user modification.

The purpose of this chapter is to describe how to access the low-level controls for the terminal I/O devices.  It documents the use of interrupt characters, the keyboard characters that generate interrupts.  Then, it describes terminal tables, used to determine the meaning of the different editing characters (character delete, line delete, etc.).  Then, the "dribble file" facility that allows terminal I/O to be saved onto a file is presented ({PageRef Term Dribble Files}).  Finally, the low-level functions that control the mouse and cursor, the keyboard, and the screen are documented.




{Include InterruptChars}

{Include TerminalTables}

{Include Dribble}

{Include Mouse}

{Include Keyboard}

{Include Screen}





{Begin SubSec Miscellaneous Terminal I/O}
{Title Miscellaneous Terminal I/O}
{Text

{index *PRIMARY* Speaker in terminal}
{index *PRIMARY* Bell in terminal}

{FnDef {Name RINGBELLS} {Args N}
{Text
Flashes (reverse-videos) the screen {arg N} times (default 1).  On the Xerox 1108, this also beeps through the keyboard speaker.
}}


{FnDef {Name PLAYTUNE} {Args Frequency/Duration.pairlist}
{Text
On the Xerox 1108, {fn PLAYTUNE} plays a sequence of notes through the keyboard speaker.  {arg Frequency/Duration.pairlist} should be a list of dotted pairs {lisp ({arg FREQUENCY} . {arg DURATION})}.  {fn PLAYTUNE} maps down its argument, beeping the 1108 keyboard buzzer at each frequency for the specified amount of time.  Specifying {lisp NIL} for a frequency means to turn the beeper off the specified amount of time.  The units of time are {lisp TICKS} ({PageRef (Timer Unit) TICKS}), which last about 28.78 microseconds on the Xerox 1108.  {fn PLAYTUNE} makes no sound on a Xerox 1132.  The default "simulate" entry for control-G (ASCII BEL) on the 1108 uses {fn PLAYTUNE} to make a short beep.
}}

{fn PLAYTUNE} is implemented using {fn BEEPON} and {fn BEEPOFF}:

{FnDef {Name BEEPON} {Args FREQ}
{Text
On the Xerox 1108, turns on the keyboard speaker playing a note with frequency {arg FREQ}, measured in {lisp TICKS} ({PageRef (Timer Unit) TICKS}).  The speaker will continue to play the note until {fn BEEPOFF} is called.
}}

{FnDef {Name BEEPOFF} {Args}
{Text
Turns off the keyboard speaker on the Xerox 1108.
}}

{index Maintanance panel}
{index Setting maintanance panel}

{FnDef {Name SETMAINTPANEL} {Args N}
{Text
On the Xerox 1108, this sets the four-digit "maintanance panel" display on the front of the computer to display the number {arg N}.
}}

}{End SubSec Miscellaneous Terminal I/O}


}{End Chapter Terminal Input/Output}