Operation [ COBOL/HP-UX Operating Guide for the Series 700 and 800 ] MPE/iX 5.0 Documentation
COBOL/HP-UX Operating Guide for the Series 700 and 800
Operation
This section tells you how to invoke and use KEYBCF.
Invoking KEYBCF
To set up your own cobkeymp
file using KEYBCF, enter the command line:
keybcf
KEYBCF searches for a file called cobkeymp in the current directory and
then the COBOL system directories. If the file is found, you are asked
if you want to edit it. Answer "Y" if you want to edit the file or "N"
if you want to create a new file based on the default set of keys. If
the file is not found, one will be created.
Using KEYBCF
KEYBCF is menu driven. Once it is invoked, it displays its initial
menu as shown in Figure 24-1 .
Figure 24-1. The Main Menu
To select the option of your choice, press its associated number. The
submenu for that function is then displayed.
1.
Review Existing Function Key Definitions
Entering 1 on the main KEYBCF menu displays the Review Existing
Function Key Definitions submenu. This allows you to list all
currently defined functions keys in one of four sets: ADIS,
Animator, User or Compatibility. You can send the list to the
screen or the file KEYLIST.DMP:
the destination is displayed on the screen and toggled by pressing
5. To output the list of your choice, press its associated
number.
If Screen is selected as the destination, all the currently
defined function keys in that list are displayed together with
their hexadecimal values. To page from one screen to the next,
press any key. Once the end of the list is reached, press any key
to return to the Review Existing Function Key Definitions submenu.
If File is selected, the same information is written to the file
instead. This happens without further intervention unless the
file KEYLIST.DMP already exists, in which case you are asked
whether to overwrite it or append this list to the end. Press O
to overwrite, E to extend.
Press 6 to return to the main KEYBCF menu.
2.
Alter Function Key Definitions
Entering 2 on the main KEYBCF menu displays the Alter submenu in
which you are prompted to choose the set of function keys you wish
to alter. As with the review submenu you can select the ADIS,
Animator, User or Compatibility key lists. When you have made
your selection, a screen for that selection is displayed. As an
example, Figure 24-2 shows the screen for ADIS Key List.
Figure 24-2. The Alter Menu for the ADIS Key List
Note that nn is the hexadecimal value of the key assigned to that
function.
Each function in the function key list you select is displayed
individually, as illustrated above. To cycle from one function to
the next, without altering the key defined for each function,
press the space key. If you wish to replace any keys currently
defined in one of the lists press the new key which will perform
that function. Once you have entered the new key, the program
automatically cycles to the next function after a slight pause.
If you want to retain a currently defined function key, but wish
to add another key to perform the same function, press I before
you enter the required key. The word "Insert" will be displayed
at the bottom right of the screen. If you want to delete a
defined function key from a list press D; KEYBCF automatically
cycles to the next function.
To enter a new function key either press the actual key you want
to perform a certain function, or enter the hexadecimal sequence
for the key. If you want to enter the hexadecimal sequence press
X.You will note the word "Hex" appears at the bottom right of your
screen indicating that the program is expecting hexadecimal input.
If you enter an invalid hexadecimal sequence you will receive an
error when you attempt to cycle to the next function and you will
be prompted to enter a valid sequence. This function allows you
to define keys which may not actually appear on the keyboard you
are using, but will be available on the one on which your program
will run.
Your UNIX documentation contains details on the values for the
KEY_mnemonics.
These are 16-bit values, but you may enter them as three 8-bit
codes by typing:
FF, high-byte, low-byte
For example, KEY_DOWN has octal value 0402, or hexadecimal value
102. You can enter a code for KEY_DOWN by typing the three bytes:
FF, 01, 02
Alternatively, if you press the down arrow key on your keyboard
your system will enter these three bytes for you.
You should note that if you attempt to define a large number of
keys you may exceed the limit, in which case you will receive the
warning:
There is not enough room for that sequence
Should you do this, the only way to add additional keys is to
delete unwanted key sequences.
You can return to the Alter submenu at any time by pressing Q.
Entering 5 on this submenu returns you to the main KEYBCF menu.
3.
Save Function Key Definitions
If you wish to save any alterations you have made to any of the
function lists press 3 on the main KEYBCF menu. This saves the
amended function lists to a file called cobkeymp.
4.
Exiting from KEYBCF
Press 4 on the main KEYBCF menu to return to the operating system.
Example
The following example shows how to use KEYBCF to alter the Animator key
list. It describes the steps required to insert, delete and change key
definitions. The example assumes that the file cobkeymp has not been
previously created and hence the values shown by KEYBCF are the defaults
set up by it.
1. Invoke KEYBCF by entering:
keybcf
2. Press 2 on the KEYBCF main menu to display the submenu for
altering key lists.
3. Press 2 again to alter the Animator key list.
The screen for Animator function key 1 appears.
4. Press D to delete the definition of this key.
The screen for function key 2 now shows.
5. Press Space to skip over the key definition and continue to do so
until the screen for Cursor Up appears.
6. Press Ctrl and U. The hexadecimal value corresponding to Ctrl-U
appears as the definition of Cursor Up. This has now replaced the
old value of Cursor Up.
The screen for Cursor Down should now appear.
7. Press I to insert a definition and then press Ctrl and D. The
hexadecimal value for Ctrl-D appears. The next screen is then
displayed showing the value for Cursor Down which already exists,
that is, there are now two definitions available for Cursor Down.
8. Press Q to quit and return to the submenu.
9. Press 5 to return to the main menu.
10. Press 3 to save the new function key definitions. This creates
the cobkeymp file.
11. You may now wish to press 1 to enter the submenu to review the
keys followed by 2 to review the Animator key list definitions.
This will show the values of all keys in the Animator key list and
will contain the new values entered. If the keys were reviewed
press 5 to return to the main menu.
12. Press 4 to Exit.
In order to demonstrate the changes made in KEYBCF, it is necessary to
invoke Animator. (See Chapter 4 , Animating for instructions on
invoking Animator.)
After entering Animator, the animator screen will appear.
When you press:
F1=Help Nothing should happen since the definition of Animator
function key 1 was deleted.
Cursor-Up Nothing should happen. Now press Ctrl-U. This now acts
as Cursor-Up since the definition of Cursor Up was
changed.
Cursor-Down This still moves the cursor down one line.
Ctrl+D This also moves the cursor down one line since Ctrl-D was
inserted as a new definition, and the old definition was
retained.
The defaults can be recovered by either using KEYBCF and returning the
key definitions to their old values, or by simply deleting cobkeymp.
List of Standard ADIS Key Functions
0. Terminate Accept
This function terminates the ACCEPT. The first byte of any CRT STATUS
field (pic 9 display) is set to the character "0" (ASCII 48) and the
second byte (pic 9(2) comp-x) is set to 0.
1. Terminate Program
If enabled, this function causes the "Abort confirmation" message to be
output to the screen and a character requested from the user. If the
user responds with anything other than "Y" or "y", the message is blanked
and normal processing of the Accept continues. If the operator keys the
"Y" or "y" or no message is configured, the program is terminated as if a
STOP RUN had been executed.
2. Carriage Return
The cursor is moved to the first character position that occurs within a
field at or after column one on the next or subsequent line of the
screen. If there is no such field, no action takes place.
3. Cursor Left
Moves the cursor to the previous character in the field. If the current
character is the first character of the field, the cursor is moved to the
last character of the preceding field. If the current character is the
first character of the first field on the screen, an error is signaled to
the user.
4. Cursor Right
Moves the cursor to the next character in the field. If the current
character is the last character of the field, the cursor is moved to the
first character of the next field. If the current character is the last
character of the last field on the screen, an error is signaled to the
user.
5. Cursor Up
The cursor is moved to the next unprotected character position (that is,
a position that occurs in a field) in direct line above the current
position.
6. Cursor Down
Moves the cursor to the next unprotected character position in direct
line below the current position.
Note: For cursor up/cursor down (functions 5 and 6), cursor movement
functions follow the same rules as CURSOR IS items if a position
is found that is within a field but is protected by virtue of
containing an insertion character or a suppressed numeric digit.
In such situations the cursor is moved right to the first
unprotected character position within that field (if all such
positions are protected, the cursor is moved to the last
unprotected character position within the field).
7. Move to the Start of the Screen
Moves the cursor to the first unprotected character position of the
current screen.
8. Move to Next Tab Position
Moves the cursor to the next column tab stop position. The cursor is
never moved forward further than the first available character position
after the end of the current field (or line in multi-line fields).
9. Move to Previous Tab Position
Moves the cursor to the previous column tab stop position. The cursor is
never moved back further than the last available character position
before the start of the current field (or line in multi-line fields).
10. End
Moves the cursor to unprotected character positions in the order:
1. The last character position of the current line in a multi-line
alphanumeric field.
2. The last character position of the current field.
3. The first character position of the last field on the current
screen.
11. Move to Next Field
Moves the cursor to the first unprotected character position of the next
field on the screen. If already in the last field and auto-skip out of
ACCEPT is not enabled for this key, the cursor is positioned to the last
character of the field and the request is considered to have been
unsuccessful.
12. Move to Previous Field Moves the cursor to the first unprotected
character position in the current field. If already at first position,
move to the first character position of the previous field. If the
cursor is already at the first character of the first field, the request
is considered unsuccessful.
13. Change Case of Current Character
Fetches the character at the current cursor position, flips its case if
alphabetic and processes it as if it were just keyed. The function is
not permitted in numeric or Kanji fields. A flip-case operation on a
non-alphabetic character is treated as equivalent to simply typing the
character again. The function cannot be used to override the "fold to
upper-case" mechanism which will simply re-invert the case if an attempt
is made to fold a character to lower-case.
14. Backspace Character
Moves the cursor to the unprotected character position logically
preceding the current one, pushes the character there into the retype
buffer and replaces it with one popped from the restore buffer. When in
insert mode, removal is achieved by moving the remaining characters in
the field along one position and popping a character from the overflow
buffer to occupy the gap at the end. In either case, if the relevant
buffer is empty or the next character is not valid for the field, a space
or zero (according to type of field) is used. Action is slightly
different when to the left of the decimal point in numeric fields, but
the logical effect is normally the same - that of reversing the effect of
typing a character.
One unusual effect emanating from the logical requirements is that where
the cursor was unable to move out of a field when a character was keyed
into the last position, the cursor is not moved prior to character
replacement.
15. Retype Character
Pops a character from the restore buffer and proceeds as if it had been
received from the keyboard. An error is signaled to the user if the
buffer is empty or the character is illegal in the current field.
16. Insert Single Character
Places a space or zero character (according to the field type) under the
current cursor position, making room for it by shuffling characters along
the field. Except when to the left of the decimal point in numeric
fields, significant characters may be pushed off the end (the character
that is lost is pushed into the overflow buffer and an error is signaled
to the user). When to the left of the decimal point in a numeric field,
an attempted insertion will be unsuccessful if a significant digit would
otherwise be lost or if the cursor is on the leftmost digit position
(since the functionality of numeric insertion operations in these
circumstances implies a requirement to insert before the current digit).
17. Delete Character
Pushes the character currently under the cursor into the restore buffer,
moving the remaining characters in the field left by one position and
pops a character from the overflow buffer to occupy the gap at the end.
If the overflow buffer is empty a space or zero (according to type of
field) is used.
Action is slightly different when to the left of the decimal point in
numeric fields, but the logical effect is normally the same - that of
reversing the effect of inserting or restoring a character. If the field
is numeric, the character is discarded and not pushed into the restore
buffer.
18. Restore Character
The effect and restrictions of this function are identical to insert
character (16 above) except that the character to be inserted is popped
from the restore buffer. An error is signaled to the user if the buffer
is empty or if the character popped is not valid in the current field.
This function is not available in numeric fields.
19. Clear to End of Field
Characters at and to the right of the current cursor position in the
current field are pushed into the restore buffer and replaced by spaces
or zeros (according to type of field). Operation is from left to right
and includes trailing nonsignificant spaces and zeros. The cursor does
not move. Multi-line alphanumeric fields are treated as being split at
line boundaries for the purposes of this operation.
20. Clear Field
The entire contents of the current field (or the current line in the case
of a multi-line alphanumeric field) are pushed into the restore buffer as
for clear to end of field on the first character position. The field
then has spaces (alphanumerics) or zeros (numerics) moved to it and the
cursor is placed on its initial position as defined for the type and
format of the field.
21. Clear to End of Screen
The action defined for clear to end of field is performed on the current
field (or line), and the following fields have spaces or zeros moved to
them, as appropriate.
22. Clear Screen
All fields on the screen have spaces or zeros (as appropriate) moved to
them and the cursor is moved to its home position (the first unprotected
character of the first field). The restore and retype buffers are
cleared by this function.
23. Set Insert Mode
Sets the current editing mode to insert and displays or clears any
relevant configured indicators. Any Off end of field indicator is
cleared by this function.
24. Set Replace Mode
Sets the current editing mode to replace and displays or clears any
relevant configured indicators. Any Off end of field indicator is
cleared by this function.
Note that the concept of insert mode and replace mode apply only in
alphanumeric fields. The mode flag is therefore suppressed while in
numeric fields and reinstated on moving to another alphanumeric field.
Replace Mode is sometimes known as Overtype Mode.
25. Undo
Reinstates the current field (or line) to its state when the cursor last
moved into it. Note that certain operations involving hidden moves out
of the current field (clear screen, clear to end of screen) may cause
edits to cease to be undoable as well as the more obvious operations such
as field-tab and auto-skip out.
26. Home
Moves the cursor to unprotected character positions in the order:
1. The first character position of the current line in a multi-line
alphanumeric field.
2. The first character position of the current field.
3. The first character position of the current screen.
Special Mapping Functions.
55. RM Clear Field
This function is provided for RM compatibility. During an ACCEPT, if the
UPDATE clause has been specified, a Cursor Home (function 7) is
performed, otherwise Clear Field (function 20) is performed.
56. RM Back Space
This function is provided for RM compatibility. During an ACCEPT, if the
UPDATE clause has been specified, a Cursor Left (function 3) is
performed, otherwise Backspace Character (function 24) is performed.
57. RM Tab
This function is provided for RM compatibility. During an ACCEPT, if the
UPDATE clause has been specified, a Terminate Accept (function 0) is
performed, otherwise there is no action.
58. Insert Toggle
If the current mode is insert mode, Set Replace Mode (function 24) is
performed, otherwise Set Insert Mode (function 23) is performed.
59. Replace Toggle
If the current mode is replace mode, Set Insert Mode (function 23) is
performed, otherwise Set Replace Mode (function 24) is performed.
60. Forward Tab
If in a multi-field ACCEPT, Move to next field (function 11) is
performed, otherwise Move to next tab stop (function 8) is performed.
61. Backward Tab
If in a multi-field ACCEPT, Move to previous field (function 12) is
performed, otherwise Move to previous tab stop (function 9) is performed.
62. Restore
If the current field is numeric or the restore buffer is empty, Insert
Single Character (function 16) is performed, otherwise Restore Character
(function 18) is performed.
255. Undefined Mapping
This value is used if no key has been set up for a particular function.
MPE/iX 5.0 Documentation