XEROX TEDITKEY 2 4 1 TEDITKEY 1 4 By: Greg Nuyens (Nuyens.pa@Xerox.com) Uses: KEYOBJ, DLIONFNKEYS TEditKey is a package that provides a keyboard interface to TEdit. On a Dandelion, the interface takes advantage of the special keys to the left, top, and right of the main keyboard. On a Dorado or Dolphin, a window mimicking the Dandelion function keys provides some of the same abilities. The abilities provided include allowing the user to alter the caret looks (the looks of characters typed in) or the selection looks. These commands are given using the Dandelion function keys and/or metacodes. (Metacodes are keys typed while a meta key is held down. The default meta key is the tab key; to alter this see "User Switches" below.) Other metacodes and control codes move the cursor within the document (beginning/end of line, back/forward a character, up/down a line, etc.). Thus, many of the special Dandelion keys are made to function in TEdit the way they are labeled. The following keys change their behavior once TEditKey is loaded. CENTER modifies the justification of the paragraph(s) containing the current selection. If the selection was left justified, then hitting the CENTER key makes it centered. Hitting it again produces right and left justification. BOLD boldfaces the selection. All other properties remain unchanged. Holding the shift key down while hitting BOLD will make the selection become un-bold. ITALICS italicizes the selection. Shift-ITALICS is the opposite. UNDERLINE underlines the selection. Shift-UNDERLINE is the opposite. SUPERSCRIPT superscripts the selection by a constant amount. Any relative superscripts (or subscripts) are maintained. Thus if "Xi" is selected in "the set Xi is empty" then pressing the SUPERSCRIPT button produces "the set Xi is empty." See "User Switches" below for how to set the increment. Shift-SUPERSCRIPT is the same as SUBSCRIPT. SUBSCRIPT is analogous to SUPERSCRIPT. SMALLER decreases the font size of the selection. All relative size differences are maintained. E.g.,"this is bigger than that" produces "this is bigger than that." Shift-SMALLER (labeled LARGER) does the opposite. DEFAULTS makes the selection have default looks. N.B.: The default looks can be set to the current caret looks by typing shift-DEFAULTS. The above keys all affect the caret looks if the keyboard key is held down when they are hit. Thus holding down KEYBOARD and then hitting UNDERLINE makes the caret looks be underlined. FONT changes the font of the selection or caret looks according to the following table (to alter this table see "User Switches" below): 1 Times Roman 2 Helvetica 3 Gacha 4 Modern 5 Classic 6 Terminal 7 Symbol 8 Hippo Thus, to change the font of the selection to Classic, hold down FONT and hit 5. To change the caret font to Classic, hold down FONT (to signal the font change) and KEYBOARD (to direct the change to the caret looks) then hit 5. Note that this table is part of the menu displayed when the HELP button is pressed. On a Dorado, middle-blank is the FONT key. KEYBOARD applies any changes that occur while this key is down to the caret looks instead of the selection. On a Dorado, bottom-blank is the KEYBOARD key. AGAIN invokes the redo facility in TEdit. A wide variety of operations can be repeated very simply by making a selection, performing an operation (for instance, an insertion), then picking a new selection and hitting the AGAIN key. The AGAIN key is an ESCape key, which acts as the TEdit REDO syntax class. (See page 20.22 of the Interlisp Reference Manual.) OPEN opens a blank line at the current cursor position. OPEN is also used to type a linefeed outside of TEdit (for example to the function FILES?). FIND prompts the user for a target string, then searches from the selection forward. NEXT acts as the TEdit NEXT syntax class. (It goes to the next field to be filled in. These fields are marked as follows: >>text to be substituted<< .) shift-NEXT transfers the TTY (which window will receive typed characters) to the next window which can accept typein. Thus one can cycle through the open text windows (mail windows, top level lisp windows, TEdit windows, etc.) without using the mouse. EXPAND expands TEdit abbreviations. (See page 20.31 of the Interlisp Reference Manual.) HELP displays a menu of the keybindings until a mouse key is clicked. UNDO acts as the TEdit UNDO syntax class. Note that it still retains its TELERAID function as does STOP. There are TEditKey operations (such as Transpose Characters) that are implemented with multiple TEdit operations. Since TEdit will UNDO only single operations, it does not fully UNDO these operations. RightArrow enters \, and | when shifted. (Recall that AGAIN is an escape key.) MARGINS indents the margins of the paragraph selected. Shift-MARGINS exdents the margins. If the right margin is a floating margin, it is left unchanged. To control the amount by which the margins are moved, see "User Switches." As well as the previous functions available on the Dandelion's special keys, the following functions are available on the standard keyboard (thus usable on the Dandelion, Dolphin, and Dorado). Each function is shown with the key that invokes it (in conjunction with the control (denoted ^) or meta (denoted #) key). Thus, for the sixth entry, holding down the metakey and hitting f (or "F") would move the caret one word forward. (To find out how to get a metakey see "User Switches" below.) #/ defaults the caret looks #= queries caret looks #9 smaller caret font #0 larger caret font ^b back character ^f forward character #b back word #f forward word ^p previous line ^n next line ^a beginning of line ^e end of line #< beginning of document #> end of document #s select whole document ^k kills line (delete from caret to end of line) ^o opens line ^d deletes character forward (also on shift backspace) #d deletes word forward (as always ^w deletes word backward) ^t transposes characters #[ indents paralooks. Also available on the MARGINS key #] exdents paralooks. Also available as shift-MARGINS #j justification change (same as CENTER key) #u uppercases selection #c capitalizes selection #l lowercases selection #o inserts object into document #? shows keybindings (same as HELP) #r restores the display Note that the positions of any of these functions can be individually changed using TEDIT.SETFUNCTION (see page 20.30 of the Interlisp Reference Manual). For wholesale customization see "User Switches" below. INTERRUPTS Any operation can be aborted by typing the STOP key. This can be used to abort font changes, GETs, PUTs, etc. A stronger form of interrupt is available as shift-STOP, which prompts the user for a menu of processes to interrupt. ^G is available as a synonym for hitting the STOP key within TEditKey. Outside of TEdit, however, ^G will continue to have the meaning specified in the user's init file. This is often the HELP interrupt, which acts as shift-STOP. Users who are accustomed to typing ^E as a soft interrupt should note that ^E moves to the end of the line. As discussed above, hitting the STOP key (or equivalently, typing ^G) accomplishes what ^E did. Since ^H is defined to be the Backspace action in TEditKey, users cannot type ^A to erase characters even outside of TEditKey (Interlisp-D currently does not allow multiple backspace characters). In addition to the changed functionality mentioned above (provided courtesy of TEditKey), the user should be aware of the following standard Interlisp-D/TEdit behavior: SAME operates as a LooksCopy mode key. First make a selection. Now to copy the looks from some other text simply hold down the SAME key, then select the source for the looks. (Paragraph looks can be copied the same way, but by making the final selection while in the left margin. This is the standard way to select a whole paragraph in TEdit.) MOVE and COPY act as mode keys for the selection mechanism. Thus the user can select the destination, then hold down the MOVE key and make a second selection. This selection will be moved (or COPY'd depending on the mode key used) to the (original) caret position. CONTROL operates as a mode key to signal deletion. This means that holding down the CONTROL key and selecting some text will delete that text when the CONTROL key is released. DELETE deletes the current selection when pressed. DORADO EQUIVALENTS Dandelion Key: Equivalent key on Dorado: OPEN ^o ( or ^O) SAME META FIND finds item in TEdit menu AGAIN ESC DELETE DEL COPY SHIFT MOVE CTRL-SHIFT PROP'S META or LOCK depending on switches NEXT #n ( or #N) EXPAND ^x (or ^X) HELP #? MARGINS #[ (unnest (which is shift-MARGINS on the Dandelion) is #] ) FONT top blank KEYBOARD middle blank UNDO bottom blank STOP ^G shift-STOP #^S (intentionally difficult to type accidentally) The function keys (CENTER, BOLD, etc.) are all available on the function key window brought up when TEditKey is loaded on a Dorado. Note that the function key window can be rebuilt on a Dorado by selecting "Function Keys" in the default TEdit menu (obtained by buttoning in the title bar of a TEdit window). USER SWITCHES TEDITKEY.METAKEY The user must choose a metakey to make use of TEditKey. The value of the variable TEDITKEY.METAKEY is the name of the key that will be your metakey. For instance to make TAB (the default) your metakey, (SETQ TEDITKEY 'TAB) before loading TEditKey. (Note that even in the standard system, TAB is available as Control-I). NOTE: METASHIFT (see page 18.9 of the Interlisp Reference Manual) is redefined to operate on TEDITKEY.METAKEY instead of on the bottom-blank key of the Dorado. The operation of TEditKey is controlled by the following (INITVARed) variables: TEDITKEY.LOCKTOGGLEKEY is the key that will be turned into a lock-toggle. If it is non-NIL, that key is set to act as a lock-toggle. Thus hitting this switches the case of the type-in. For those users who have removed the spring from their lock key, TEDITKEY.LOCKTOGGLEKEY is usually PROP'S. The action of LOCK is then made to be '(CTRLDOWN. CTRLUP) providing the user with a control key where LOCK is located and a lock toggle where PROP'S is located. TEDITKEY.FONTS is an eight-element list of the fonts that are invoked by meta-1 through meta-8. The defaults are listed above. TEDIT.DEFAULT.CHARLOOKS defines the looks that result when the DEFAULTS key is pressed or when default caret looks are requested. It is an instance of the CHARLOOKS datatype. To preset it, for instance, to TIMESROMAN 10 type the following to the Lisp top level. (SETQ TEDIT.DEFAULT.CHARLOOKS (CHARLOOKS.FROM.FONT (FONTCREATE 'TIMESROMAN 10))) However, a much simpler method is to select an instance of the desired looks and type shift-DEFAULTS. TEDITKEY.VERBOSE if T (the default), the functions that modify the caret looks print feedback in the (TEdit) prompt window. TEDITKEY.NESTWIDTH is the distance (in points) that the indent and exdent functions move the margins. Initially 36 points (0.5 inches). \TK.SIZEINCREMENT is the amount (in points) which the LARGER function increases the selection (and conversely for SMALLER). Initially 2 points. TEDITKEY.OFFSETINCREMENT is the amount (in points) which the SUBSCRIPT function raises the selection (and conversely for SUPERSCRIPT). Initially 3 points. TEDITKEY.KEYBINDINGS is the list that controls the mapping of keys to functions for the functions that are common to the Dandelion, Dorado, and Dolphin. It consists of triples of function name, list of CHARCODE-style character specifications, and a comment describing what the function does. (The comments are used by the automated menu-building tools and their inclusion is encouraged.) TEDITKEY.DLION.KEYACTIONS is the list that specifies the key actions of the non-Alto keys (to the left and right) on the Dandelion. It is the format acceptable to MODIFY.KEYACTIONS (see page 18.9 of the Interlisp Reference Manual). TEDITKEY.DLION.KEYBINDINGS is the list specifying the functions to be tied to the characters generated from above. The keynames in the CAR of each element are comments. Note that TEDIT.DLION.KEYACTIONS and TEDIT.DLION.KEYBINDINGS must be coordinated (similarly for TEDITKEY.FNKEYACTIONS and TEDITKEY.FNKEYBINDINGS). TEDIT.DLION.KEYSYNTAX is the list of syntax classes to be applied to the Dandelion keys. TEDITKEY.FNKEYACTIONS is the list that specifies the keyactions of the function keys (center, bold, etc.). TEDITKEY.FNKEYBINDINGS is analogous to TEDIT.DLION.KEYBINDINGS but for the function keys. TEDITKEY.DORADO.KEYACTIONS are the keyactions unique to the Dorado (and Dolphin). TEDITKEY.DORADO.KEYSYNTAX is analogous to TEDIT.DLION.KEYSYNTAX. The previous variables in conjunction with the following functions specify the effect of TEditKey. (TEDITKEY.INSTALL readtable) invokes the keyactions and bindings as specified by the above variables on readtable. (Readtable defaults to TEDIT.READTABLE). (\TK.BUILD.MENU) is a function that automagically builds the help menu from the values of the above variables. (LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC) STARTINGPAGE# 429) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 42 72 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 42 72 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))))).È0.Èx(È(È (È(ŠŠ8(ŠŠ8DÈÈ PAGEHEADING RUNNINGHEAD  TIMESROMAN MODERNMODERN MODERN ÿüMODERN ÿþMODERN ÿþMODERN MODERN MODERN MODERNMODERN LOGO   HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN   HRULE.GETFNMODERN   HRULE.GETFNMODERN  ''> #~¢ß–9  0 xBC+ a$ 5‚¹…     9*“G ‘P” ñ5 @1 Eàð  17=97.!$} : çèÍƨXþª-(  #  =  4„¯Tá& `O²qñQdkvƒr² #CUC7'b M  ]3H®zº