Although we have already briefly described the action of the character and cursor keys in the Basics webpage, we include them again here, both for completeness and to allow us to provide additional details. Note that characters keys are included among the TYPING/INSERT mode operations. (Typing the Z key invokes an operation to enter Z in the corefile.)
Operation: Normal typing (text and records)
Purpose: Enter a character in the corefile
Default Keys: see below
Operation Number: 2, 3 or 4
The character typed at the keyboard is entered into the corefile at the position of the cursor, generally replacing the one already there (in TYPING submode), or being inserted before it (in INSERT submode). In the case of records, a character is lost at the end of a field if the new one is inserted when the field is full (and a beep occurs).
For digits, punctuation, basic symbols and the letters of the English alphabet, the standard keys are used.
French accented characters are obtained with the following key sequences:
|à (a grave)||esc A|
|â (a circumflex)||esc esc a|
|ç (c cedilla)||esc c|
|é (e acute)||esc e|
|è (e grave)||esc E|
|ê (e circumflex)||esc esc e|
|î (i circumflex)||esc esc i|
|ô (o circumflex)||esc esc o|
|ù (u grave)||esc U|
|û (u circumflex)||esc esc u|
To obtain other accented vowels (upper-case, tilde, umlaut), type any accented form of the vowel. The key <CTRL-L> then causes that vowel to cycle through all its accented forms. This also applies to Ç.
No default key sequences exist for other Latin-1 characters, such as n-tilde, though it is possible create them by changing key assignments. These characters can also be FEtched in files.
WARNING: No attempt should be made to introduce the character y-umlaut into a corefile. Its Latin-1 value, 255 or -1, is used as an internal flag byte, and its use as a character may cause a variety of damaging effects.
Three different "operation numbers" are used for character keys:
Operation: Cursor return
Purpose: Move the cursor to the start of the next record or the left margin of the next text line.
Default Key: <RETURN> or <LINEFEED>
Operation Number: 1
This operation has three variants, which can be selected with the EDitor option command. The default is option 1. If option 0 has been selected and the editor is currently in INSERT submode, a new line or new record will be inserted and the cursor will be moved to the left margin of a text line or start of the new record.
If option 2 has been selected and the cursor is currently on the bottom line of the displayed section, a new page will be displayed before cursor is moved, and the cursor will therefore appear at the top of the new page. This is particularly useful if you write a function or procedure to process each line of a long text, since it saves the return operation having to redisplay a whole page before every line.
Either key may be used. <CTRL M> and <CTRL J> are synonymous with <RETURN> and <LINEFEED> respectively. (This is meant literally. The byte corresponding to <RETURN> is the same as the one corresponding to <CTRL M>, etc.) You are advised not to reassign <LINEFEED>, since this affects some other activities too.
Operation: Insert mode
Purpose: Toggle the editor between INSERT and TYPING submodes.
Default Key: <CTRL W>
Operation Number: 22
Operation: Insert line
Purpose: Insert a new text line or record following the cursor line and move the cursor to it.
Default Key: <CTRL F>
Operation Number: 10
A new text line will be blank. A new record will comprise a number of empty fields, with the number of fields being specified by default or set by the user.
Operation: Insert several lines
Purpose: Insert several new text lines or records following the cursor line
Default Key: <ESC> <ESC> h <number> <RETURN>
Operation Number: 93
One of the few IVI operations (as distinct from commands) which requires a parameter. <number> denotes any integer. It is terminated by the <RETURN> or indeed by any non-digit (which is thrown away). This many new lines or records are inserted below the cursor line. The cursor is not moved.
Purpose: Delete the character under the cursor
Default Key: <DEL> or <BACKSPACE>
Operation Number: 5
The Delete operation deletes the character under the cursor and moves the rest of the line one place left to close up the gap. If the cursor is beyond the right hand end of a line, a cursor left is performed. If the cursor is immediately to the right of the last character on the line, the cursor is moved to the left and the last character is deleted. If the cursor is in column 1 of an empty line (other than the last line of the file), the operation removes the line.
Text characters cannot be deleted while the corefile is set to a record view, nor can record characters be deleted while the corefile is set to text view. Attempts to delete a | symbol from a record in record/text view simply move the cursor left.
The 80 most recently deleted characters are stored in a circular buffer, and can be recovered by the Recover character operation. The latter allows recovery of items deleted accidently, and permits a short string to be moved from one place to another.
Either key may be used. <CTRL H> is synonymous with <BACKSPACE>.
Operation: Long delete
Purpose: Delete characters from the cursor to the end of line
(1) <ESC> <ESC> <DEL>
or (2) <ESC> <ESC> <BACKSPACE>
or (3) <ESC> <ESC> d
Operation Numbers: 69
All of the characters are placed in the recovery buffer.
(1) and (2) are set up by default for the Sun console-keyboard only. (See note under Long cursor left.) (3) applies to all environments. In the Sun console-keyboard environment, <NUMBERPAD 5> can be used instead of <ESC> <ESC>.
Operation: Delete word / Delete field
Purpose: (For text view) Delete the word containing the cursor; (for record views) delete the field containing the cursor
Default Keys: <ESC> <CTRL D>
Operation Number: 79
All of the characters are placed in the recovery buffer. For record views, a backslash character is placed in the buffer to mark the end of the field.
Operation: Delete end of word
Purpose: Deletes the current word from the cursor onwards
Default Key: <ESC> <ESC> W
Operation Number: 80
All of the characters are placed in the recovery buffer.
Operation: Recover character
Purpose: Remove the last character from the delete buffer and insert it at the cursor position.
Default Key: <CTRL U>
Operation Number: 65
The character is inserted regardless of the TYPING or INSERT submode. The cursor is not moved.
Characters are recovered from the buffer in reverse order of their deletion, but because the cursor is not moved, repeated use reinserts a string in its original order, provided that it was deleted from its beginning. (Note, though, that if the phrase was removed by deleting it backwards from the end of a line, recovery will be in the wrong order.)
Delete and Recover character can be used to move a phrase from place to place.
Operation: Copy character
Purpose: Copy the character at the cursor into the delete buffer for subsequent recovery. The cursor moves right.
Default Key: <CTRL G>
Operation Number: 11
This is the inverse of Recover character. The two can be used to copy a phrase from place to place.
Operation: Copy field
Purpose: (For record views only) Copy the field containing the cursor into the delete buffer for subsequent recovery.
Default Key: <ESC> <CTRL B>
Operation Number: 78
A backslash character is placed in the buffer to mark the end of the field.
For text view, this key sequence invokes Repeat line
Operation: Recover field
Purpose: (For record views only) Recover a field from the delete buffer and insert it at the cursor position.
Default Key: <ESC> <CTRL T>
Operation Number: 40
The backslash character which marks the end of the field in the buffer is discarded.
Operation: Cursor left, right
Purpose: Move the cursor one position left or right, adjusting the window if necessary.
Default Keys: <left>, <right>
Operation Number: 17, 19
For historic reasons, Cursor right is also assigned to <CTRL X>.
Operation: Cursor up, down
Purpose: (For text and record/text views) Move the cursor one line up or down, adjusting the window if necessary; (for record/template view) move the cursor to the previous or next field.
Default Keys: <up>, <down>.
Operation Number: 18, 20
If the cursor is moved above the first line/record of the corefile or below the last, a new line/record is inserted.
Note that in record/template view, moving the cursor to the next or previous record is the same as moving it to the next or previous page. It was therefore considered more convenient to provide arrow-keys for the next and previous field operations than to duplicate the page ones.
For historic reasons, these operations are also assigned to <CTRL Z> and <CTRL K> respectively.
Operation: Next, previous page
Purpose: Move the window down or up one page
Default Keys: <CTRL Q>, <CTRL P>
Operation Number: 30, 28
Note that in the case of text and record/text views, one page amounts to 20 or 30 lines; in record/template view, a page contains a single record.
Operation: Ascend, descend
Purpose: (Record views only) move the cursor to the previous or next field.
Default Keys: <CTRL R>, <TAB>
Operation Numbers: 23, 34
<CTRL I> is a synonym for <TAB>.
In text view, these keys invoke the Reformat and Tab cursor operations respectively.
Operation: Long cursor left
Purpose: Move the cursor to the start of line
(1) <ESC> <left>
or (2) <ESC> <ESC> b
or (3) <ESC> D
or (4) <ESC> <ESC> <left>
Operation Number: 66
Why so many alternative key-sequences? (1) is the sequence originally intended, but the default key assignments achieve this only for an environment emulating a Sun shelltool console-keyboard. There is a conflict between these assignments and the ones needed for a vt100, so the defaults cannot include both simultaneously. Alternative (2) was therefore added to provide as a common sequence between the two. (b, by the way, stands for backwards.) (3) is merely a byproduct of the settings for (1).
(4) is convenient only because <NUMBERPAD 5> on the Sun console keyboard is set to have the same effect as <ESC> <ESC>. Thus (4) is equivalent to <NUMBERPAD 5> <left>, two keys which happen to be adjacent.
Operation: Long cursor right
Purpose: Move the cursor past the end of line
(1) <ESC> <right>
or (2) <ESC> <ESC> f
or (3) <ESC> C
or (2) <ESC> <ESC> <right>
Operation Number: 68
This operation places the cursor on the space following the last non-blank on the line. Note that in spite of the name of the operation, it may move the cursor leftwards!
For comments on the alternative key-sequences, see the previous operation. (f stands for forwards.)
Operation: Next, previous word
Purpose: Move the cursor to the start of the next, previous word
Default Key: <ESC> <ESC> n, <ESC> <ESC> p
Operation Number: 81, 82
Operation: Next number
Purpose: Move the cursor past the current numerical expression
Default Key: <ESC> <ESC> m
Operation Number: 95
This is very similar to Next word, but it skips over only characters which may form a numerical expression. It is intended for use with the arithmetical operations.
Operation: Cycle characters
Purpose: Change case or cycle through accented forms
Default Key: <CTRL L>
Operation Number: 92
We have mentioned this operation earlier in connection with accented characters, but it actually serves two slightly different purposes. If the cursor is on a letter of the English alphabet, the letter is changed from upper- to lower-case, or vice versa, and the cursor is moved right. Repeated application therefore allows a phrase to be capitalized or "lowered". If the cursor is on an accented vowel (or ç), the letter is changed to another accented form of the vowel, and the cursor is not moved. So, repeated application cycles the vowel through all its accented forms, both upper- and lower-case. Non-letters are not changed, but the cursor moves right.
Currently IVI makes no use of "composed" keys (wherein the user types, say, e <BACKSPACE> ^ to enter ê), so that keys for extra characters are in short supply. The cycle operation reduces the need for more keys, but has two disadvantages. Firstly, it is a TYPING/INSERT mode operation, and cannot be used to enter characters in the command line, say, for specifying a FInd parameter. Secondly, some of the Latin-1 characters (the Spanish n-tilde and the Icelandic eth, for example) are not in any cycle, and cannot be entered in this way.
There are workarounds in both cases, which we leave to the entertainment of the reader!
Operation: Repeat character
Purpose: Copies the character from the line above the cursor and types or inserts it at the cursor position
Default Key: <ESC> <ESC> t
Operation Number: 77
Operation: Repeat line
Purpose: (For text view only) Copies the line above the cursor starting at the cursor column, and types or inserts it at the cursor position
Default Key: <ESC> <CTRL B>
Operation Number: 78
For record views, this key sequence invokes Copy field.
Operation: Split line
Purpose: Split the cursor line in two at the cursor
Default Key: <ESC> <ESC> s
Operation Number: 75
Operation: Join line
Purpose: Join the cursor line and the next line into one
Default Key: <ESC> <ESC> j
Operation Number: 76