Operation [ Micro Focus COBOL System Reference, Volume 1 ] MPE/iX 5.0 Documentation
Micro Focus COBOL System Reference, Volume 1
Operation
This section tells you how to invoke and use Keybcf.
Invoking Keybcf
To set up your own cobkeympfile using Keybcf, enter the command line:
component
where:
component is the program-name for the system component to be invoked,
in this case Keybcf:
DOS and OS/2 Windows UNIX
keybcf keybcfw keybcf
NOTE Where you specify the command line depends upon the operating
system you are running in. For example, in Windows and OS/2, if
you have created a group for COBOL, you double click on the
appropriate program icon to invoke the component. Full details on
the alternative methods of invoking system tools in your
environment are provided in the chapter Introduction.
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 is created.
Using Keybcf
Keybcf is menu driven. Once it is invoked, it displays its initial
menu as shown in Figure 18-1.
Figure 18-1: The Main Keybcf Menu
To select the option of your choice, press its associated number. The
menu for that function is then displayed. These menus are shown in
following sections.
Reviewing Existing Function Key Definitions.
Entering 1 from the main Keybcf menu displays the Review Existing
Function Key Definitions menu. This menu is shown in Figure 18-2.
Figure 18-2: The Review Existing Function Key Definitions Menu
This menu enables you to list all currently defined function keys in one
of four sets: Adis, Animator, user or compatibility. To output the list
of your choice, press its associated number. For example, press 2 to
output the list of Animator function keys, or 4 to output the list of
compatibility.
5 is a toggle to determine whether a selected list is shown on the screen
or written to a file. If you select the screen 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 menu.
If you select to output the list to file, the same information is written
to a file called keylist.dmp.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.
Altering Function Key Definitions.
Entering 2 from the main Keybcf menu displays the Alter menu in which you
are prompted to choose the set of function keys you wish to alter. This
menu is shown in Figure18-3.
Figure 18-3: The Alter Function Key Definition Menu
As with the Review Existing Function Key Definitions menu, 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 18-4 shows the screen for Adis Key List.
Figure 18-4: The Alter Menu for the Adis Key List
Each function in the function key list you select is displayed
individually. For example, the function displayed in Figure 18-4 is
Terminate accept. To enter a new function key press the key you want to
perform the function, or use X to enter the hexadecimal code for the key.
Once you have entered the new key, the program automatically cycles to
the next function after a slight pause. The following keys are available
on this menu:
Key Description
-------------------------------------------------------
Space Cycles from one function to the
next, without altering the key
defined for each function.
Insert Adds another key to perform the
displayed function, but retains the
currently defined function key. The
word Insert is displayed at the
bottom right of the screen.
Delete Deletes a defined function key from
a list press. Keybcf automatically
cycles to the next function.
Table 18-0. (cont.)
Key Description
HeX Specifies that you will enter the
hexadecimal sequence for the
required function key. The word Hex
is displayed at the bottom right of
the screen. If you enter an invalid
hexadecimal sequence you receive an
error when you attempt to cycle to
the next function and you are
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.
Quit Returns to the Alter menu.
If you attempt to define a large number of keys you may exceed the limit,
in which case you receive the warning:
There is not enough room for that sequence
Should this occur, the only way to add additional keys is to delete
unwanted key sequences.
Press 5 to return to the Keybcf main menu.
Your UNIX documentation contains details on the values for the KEY_
mnemonics. These are 16-bit values, but you can 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 enters these three bytes for you.
Saving Function Key Definitions.
If you want to save any alterations you have made to any of the function
lists, press 3 from the Keybcf main menu. This saves the changed
function lists to a file called cobkeymp
Exiting from Keybcf.
Press 4 from the Keybcf main 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.
1. Invoke Keybcf. See the section Invoking Keybcf earlier in this
chapter for details on how to do this.
2. Press 2 from the Keybcf main menu to display the Alter menu.
3. Press 2 to specify that you want 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 now appears.
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 Alter menu.
9. Press 5 to return to the Keybcf main menu.
10. Press 3 to save the new function key definitions. This creates
the cobkeymp file.
11. You can review the changes you have just made by pressing 1 This
enters the Review Existing Function Key Definitions menu. Press 2
12. from this menu to review the Animator key list definitions. This
shows the values of all keys in the Animator key list and contains
the new values entered. Press 6 to return to the Keybcf main menu
when you have reviewed all of the Animator function keys.
13. Press 4 to exit from Keybcf.
In order to demonstrate the changes you have just made using Keybcf, it
is necessary to invoke Animator. See the chapter Animator for
instructions on invoking Animator.
After entering Animator, the Animator screen appears.
When you press:
Key Description
----------------------------------------------------
F1=Help Nothing happens because the definition
of Animator function key 1 was deleted.
^ Nothing happens because the definition
of ^ was changed.
Ctrl+U The cursor moves up one line. This is
because Ctrl+U was mapped onto the
function to move the cursor up one
line.
v This still moves the cursor down one
line.
Ctrl+D This also moves the cursor down one
line because Ctrl+D was inserted as a
new definition, and the old definition
(v) 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.
Standard Adis Key Functions
0 - Terminate Accept.
This function terminates an ACCEPT operation. The first byte of any CRT
STATUS field (defined as pic 9 display) is set to the character "0"
(ASCII 48) and the second byte (defined as 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 operation continues. If the user
presses "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 and cursor down (functions 5 and 6), cursor movement
functions follow the same rules as items defined using the CURSOR
IS clause 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
an 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.
Retrieves the character at the current cursor position, changes its case
if alphabetic and processes it as if it were just keyed. The function is
not permitted in numeric or Kanji fields. Changing case 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 simply re-inverts 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 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 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 can 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 is 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 (function 16 above) except that the character to be inserted is
popped from the restore buffer. An error is signaled 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.
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. Operations involving hidden MOVE operations out of the
current field (clear screen, clear to end of screen) can 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
operation, if the UPDATE clause is specified, a Cursor Home (function 7)
is performed, otherwise Clear Field (function 20) is performed.
56 - RM Backspace.
This function is provided for RM compatibility. During an ACCEPT
operation, if the UPDATE clause is 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
operation, if the UPDATE clause is 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