1147 lines
83 KiB
Plaintext
1147 lines
83 KiB
Plaintext
1
|
||
|
||
Interlisp-D Reference Manual
|
||
1
|
||
|
||
Interlisp-D Reference Manual
|
||
30. TERMINALINPUT/OUTPUT
|
||
1
|
||
|
||
30. TERMINALINPUT/OUTPUT
|
||
1
|
||
|
||
|
||
"30"30. TERMINALINPUT/OUTPUT
|
||
6
|
||
|
||
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 (see the Dribble Files section below). Finally, the low-level functions that control the mouse and cursor, the keyboard, and the screen are documented.
|
||
Interrupt Characters
|
||
1
|
||
|
||
Errors and breaks can be caused by errors within functions, or by explicitly breaking a function. The user can also indicate his desire to go into a break while a program is running by typing certain control characters known as "interrupt characters". The following interrupt characters are currently enabled in Interlisp-D:
|
||
Note: In Interlisp-D with multiple processes, it is not sufficient to say that "the computation" is broken, aborted, etc; it is necessary to specify which process is being acted upon. Usually, the user wants interrupts to occur in the TTY process, which is the one currently receiving keyboard input. However, sometimes the user wants to interrupt the mouse process, if it is currently busy executing a menu command or waiting for the user to specify a region on the screen. Most of the interrupt characters below take place in the mouse process if it is busy, otherwise the TTY process. Control-G can be used to break arbitrary processes. For more information, see Chapter 23.
|
||
Control-B Causes a break within the mouse process (if busy) or the TTY process. Use Control-G to break a particular process.
|
||
Control-D Aborts the mouse process (if busy) or the TTY process, and unwinds its stack to the top level. Calls RESET (see Chapter 14).
|
||
Control-E Aborts the mouse process (if busy) or the TTY process, and unwinds its stack to the last ERRORSET. Calls ERROR! (see Chapter 14).
|
||
Control-G Pops up a menu listing all of the currently-running processes. Selecting one of the processes will cause a break to take place in that process.
|
||
Control-P Changes the PRINTLEVEL setting of PRINTLEVEL (see see Chapter 25) in the TTY process. This allows the PRINTLEVEL setting to be changed dynamically, even while Interlisp is printing.
|
||
When Control-P is typed, Interlisp rings the bell, prints "set printlevel to:," and waits for the user to type a series of digits. Input is terminated by a non-digit, after which the program continues.
|
||
If the input is terminated by a period or an exclamation point, the CAR printlevel is immediately set to this number, and printing continues with the (possibly new) printlevel. If the print routine is currently deeper than the new level, all unfinished lists above that level will be terminated by "--)". Thus, if a circular or long list of atoms, is being printed out, typing "control-P0." will cause the list to be terminated immediately.
|
||
If the input is terminated by a comma, another number may be typed terminated by a period or exclamation point. The CAR printlevel will then be set to the first number, the CDR printlevel to the second number.
|
||
In either case, if a period is used to terminate the printlevel setting, the printlevel will be returned to its previous setting after the current printout has finished. If an exclamation point is used, the change is permanent and the printlevel is not restored (until it is changed again).
|
||
Control-T Prints status information for the TTY process. First it prints "IO wait," "Waiting", or "Running," depending on whether the TTY process is currently in waiting for characters to be typed, waiting for some other reason, or running. Next, it prints the names of the top three frames on the stack, to show what is running. Then, it prints a line describing the percentage of time (since the last control-T) that has been spent running a program, swapping, garbage collecting, doing local disk i/o, etc. For example:
|
||
Running in TTWAITFORINPUT in TTBIN in TTYIN1
|
||
95% Util, 0% Swap, 4% GC
|
||
DELETE Clears typeahead in all processes.
|
||
The user can disable and/or redefine Interlisp interrupt characters, as well as define new interrupt characters. Interlisp-D is initialized with the following interrupt ÿÿ |