


The ACUCOBOL-GT keyboard interface may be modified via two variables in the runtime configuration file:
The KEYBOARD variable defines global keyboard attributes. The KEYSTROKE variable defines the interpretation of a particular key or key combination.
These two variables enable you to tailor the keyboard interface to your application.
4.3.2.1 The KEYBOARD variable
You can specify one or more KEYBOARD variables. Attributes that you can set are identified by one or more sets of keywords and associated values, separated from each other by spaces or tabs; the syntax is:
KEYBOARD keyword=value [keyword=value]...
Keywords are:
1. AUTO-RETURN=value
Some ACCEPT statements terminate automatically when the input field is filled. When this occurs, the termination key value is the value (a decimal number) defined by the AUTO-RETURN keyword. This value is returned in the CONTROL KEY clause of the ACCEPT statement. The default value is zero.
2. CASE=value
The CASE option on the KEYBOARD configuration entry allows you to cause all entries to be automatically converted to upper or lowercase. Value may be set to "Upper", "Lower" or "Both":
Upper all ACCEPT statements convert keystrokes to upper case.
Lower all ACCEPT statements convert keystrokes to lowercase.
Both (default) causes no translation.
CASE may be overridden with the "UPPER" and "LOWER" keywords on individual ACCEPT statements.
3. CHECK-NUMBERS=value
Normally, ACUCOBOL-GT requires that numeric data be entered for numeric and numeric-edited fields that have the CONVERT phrase specified for them. If value is "No", then any data can be entered and the runtime system will remove the non-numeric data from the user's input prior to converting. If value is set to "Yes" (the default), then a non-numeric entry will cause an error message to print and will force the user to re-enter the field. If value is set to "Validate", the runtime also checks to make sure that the numbers entered are valid, as described by the PICTURE clause for that field.
4. CURSOR-PAST-END=value
By default, ACUCOBOL-GT does not let the cursor leave the field where data is being entered. When the final position is entered, the cursor remains there and further entry is inhibited except for editing keys. Setting value to "Yes" allows the cursor to move one character past the end of the field instead. Input is still inhibited. The difference between the two modes is essentially cosmetic and CURSOR-PAST-END can be set to suit the user's taste. The default value is "No".
5. DATA-RANGE=value
Value defines the range of legal ASCII input values. Any character received that falls outside of this range will not be accepted into the input field, but may define other actions such as field editing or input termination. Two decimal numbers, separated by a comma, express the lower and upper bounds of the range. The maximum range is "1,255". The default range is "32,255".
6. EXCEPTION-RANGE=value
This is similar to the DATA-RANGE keyword except that value defines the range of characters that generate default exception handling. A key whose ASCII value falls within that range will terminate input with an exception condition value which matches the ASCII value of the key. That value is returned in the EXCEPTION clause or the CONTROL KEY clause of the ACCEPT statement. The default range is "1,31". A character in this range that is also defined by a KEYSTROKE variable acts as defined by that KEYSTROKE variable, and may or may not terminate the input.
7. IMPLIED-DECIMAL=value
If value is "Yes", an implied decimal point is inserted in certain fields when the user does not explicitly type a decimal point. The last n digits of the user's input will be to the right of the decimal point, where n is the number of decimal places specified in the receiving field. For example, if the program is accepting a field with two decimal places, and the user types "1535", the value accepted (and echoed to the screen) will be "15.35". This is only done for numeric or numeric-edited fields that are input with conversion, either explicit or implicit. It never occurs for floating-point items. The default value is "No".
8. RM-2-DEFAULT-HANDLING=value
RM/COBOL versions 2.1 and 2.2 have a configuration option that allows for ACCEPT fields that do not receive any input (e.g., the user just types Return) to leave the receiving field unchanged. Normally, the receiving field would be filled with spaces. If the RM-2-DEFAULT-HANDLING value is "Yes", then ACUCOBOL-GT will behave in this alternate fashion. This option is recommended only if you are converting programs written using this feature of RM/COBOL. Note that RM/COBOL-85 does not contain this feature, so only programs written for RM/COBOL version 2 should need to use it.
9. SCREEN-DEFAULT=value
If value is "Yes", default data is taken from the screen for any ACCEPT statement that does not have a default value specified for it (either explicitly or implicitly). This will also allow for updating of the current screen contents. The default value is "No".
4.3.2.2 The KEYSTROKE variable
The KEYSTROKE variable defines the actions to be taken for a single keystroke.
You need to add one KEYSTROKE line for each key that you wish to redefine. The maximum number of allowed KEYSTROKE entries is 170.
KEYSTROKE entries consist of keywords and associated values that describe the action to be taken, plus the key code (a two-character name) of the key, or key combination, being defined. All
definable keys have such a name. The key code is case sensitive, although the
rest of the KEYSTROKE line is not. The ASCII value of the key (decimal) may be
used instead of the key code. Note that this is the only way to assign a value to the DEL key (ASCII value 127). The syntax of the
KEYSTROKE line is:
KEYSTROKE keyword=value [keyword=value] key-code
The key-code argument is one of the two-character codes shown in the "Table of Keys", section 4.3.2.3. Keywords are separated from each other by spaces or tabs. For example:
KEYSTROKE EDIT=Next TERMINATE=13 ^M
The following keywords may be used:
1. AT-END=value
If value is "Yes", the key becomes a termination key that also causes the AT END condition. This keyword may not be specified along with either the TERMINATE or EXCEPTION keywords. The AT END condition always returns a termination value of "-1" in the CONTROL KEY clause. AT-END keystrokes are always allowed, but will cause no action unless an AT END, EXCEPTION, or CONTROL KEY clause is present in the ACCEPT verb. The default keyboard defines no AT-END keys. See also the AT END phrase of the ACCEPT verb in the ACUCOBOL-GT Reference Manual, Procedure Division.
2. DATA=value
This keyword is used to assign special characters to keys. DATA associates a decimal ASCII value with a key; the Terminal Manager will return this value to the COBOL program when the key is pressed. If the DATA keyword is used, no other keywords may be specified for this key.
3. EDIT=value
EDIT is used to define an editing action for a key. It must be assigned one of the following values:
Alt Left
Auto-Insert Menu
Backspace Next
Default-Entry Next-All
Default-Next Next-Line
Delete Numeric-Default
Down Numeric-Next
End Page-Down
Erase-All Page-Up
Erase-EOS Previous
Erase-Field Previous-All
Erase-Next Previous-Line
Erase-to-End Right
First Switch-Window
Home System-Menu
Insert-Off Toggle-Edit-Mode
Insert-On Toggle-Insert
Insert-Space Up
Last
The EDIT keyword values specify various editing functions, described below. EDIT keys may also be designated as termination keys. When they are, the EDIT is applied and then the input is terminated. This rule is slightly changed for the actions that move the cursor. With these actions, the field terminates only if the cursor cannot be moved farther in the requested direction. This is detailed in the descriptions of each of the EDIT values.
In the following descriptions, the order of fields is the order in which they appear in the Screen Section. Thus, the "next" field may not necessarily be the next one on the physical display. This feature can be used to design special purpose screens.
EDIT keyword values can be:
Alt
The character-based version of the runtime supports the use of key letters in controls. The user can activate a particular control by pressing a predesignated key in combination with the control's key letter.
Use the Alt function to designate the key to be pressed in combination with the control's key letter. Note that under Windows and MS-DOS the Alt key is predefined. On these systems the user presses the "Alt" key in conjunction with the key letter.
Auto-Insert
Auto-Insert causes all following characters to be entered in insert mode. Auto insert mode is automatically reset when the input terminates, or when any other editing key is typed. This style of insertion is the RM/COBOL-85 default method.
Backspace
The Backspace function moves the cursor to the left one character and deletes the character found there. If the Backspace function occurs at the left-most field position, it is ignored unless a TERMINATE or EXCEPTION value has been assigned to the key, in which case it is treated as a termination key.
Default-Entry
The Default-Entry action erases the remainder of the field starting at the cursor position provided that the cursor is not in the first position of the field. If the cursor is in the first position, this action does nothing. This editing action is intended to be tied to a termination key (such as the "Return" key or the "Tab" key), and to be used as a reasonable method of handling fields that contain default values. If the default is correct, then this key is typed (which does nothing to the field). If the default is wrong, then the correct value is entered and this key is typed (erasing the part of the old field after the new input).
Default-Next
Default-Next combines the Default-Entry action and the Next (described below) action.
Delete
Deletes the character that the cursor is on (if any).
Down
If there are fields below the current cursor location, the cursor moves to the one on the closest lower line. If there is more than one field on this line, the cursor will move to the one closest to its current horizontal location. The cursor will try to stay in the same column. If there are no fields beneath the current line, then this action does nothing unless an EXCEPTION or TERMINATE value has been assigned to it, in which case it acts as a termination key.
End
The cursor is moved to the end of the current field, excluding any trailing prompt characters. If the cursor is already at the end of the field, then this key is ignored unless it has a TERMINATE or EXCEPTION value, in which case it is treated as a termination key.
Erase-All
All fields controlled by the ACCEPT statement are erased and the cursor is moved to the home position of the first field. This key may not be assigned a TERMINATE or EXCEPTION value.
Under windows, the field in which the cursor is currently positioned is erased, instead of all fields controlled by the ACCEPT statement being erased.
Erase-EOS
The current field is erased from the cursor location to the end of the field, and all fields following the current one are erased. The definition of "following field" is based on the order of fields in the Screen Section. This action may not be assigned a TERMINATE or EXCEPTION value.
Under windows, the current field is erased from the cursor location to the end of the field, but the fields following the current one are not erased.
Erase-Field
The field is erased, and the cursor is moved to the first position of the field.
Erase-Next
This action combines the functions of the Erase-to-End action and the Next (described below) action.
Erase-to-End
This function erases the field from the current cursor position to the end of the field.
First
The cursor is moved to the beginning of the first field controlled by the ACCEPT statement. If the cursor is already in the first field, and the key has been assigned a TERMINATE or EXCEPTION value, then the ACCEPT terminates.
Home
The cursor is moved to the beginning of the field. If the cursor is already at the beginning and this key has been assigned a TERMINATE or EXCEPTION value, the ACCEPT terminates.
Insert-Off
If insertion mode is currently in effect, it is turned off; otherwise does nothing.
Insert-On
This causes all following characters to be entered in insert mode. This causes any trailing characters to be moved one space to the right before the added character is printed. Insertion mode stays in effect until explicitly reset by a Insert-Off, an Auto-Insert, or a Toggle-Insert action. Note that insertion mode stays in effect across multiple ACCEPT statements.
Insert-Space
A space character is inserted at the cursor position, moving trailing characters over one position.
Last
The cursor moves to the end of the last field controlled by the ACCEPT statement. Trailing prompt characters in the last field are ignored in determining the end of the field. If this key has been assigned a TERMINATE or EXCEPTION value and the cursor is already in the last field, the ACCEPT terminates.
Under windows, with TERMINATE and EXCEPITON value, if the cursor is at the last field, the ACCEPT does not terminate and the cursor stays at the current field.
Left
The cursor is moved one position to the left; if it is already in the left-most field position, it moves to the end of the previous field. If the cursor is in the left-most position of the first field, the key is ignored unless it also has been assigned a TERMINATE or EXCEPTION value, in which case the ACCEPT terminates.
Under windows, without TERMINATE and EXCEPTION value, if the cursor is in the leftmost position of the first field, the key is not ignored and the cursor is moved to the last field.
Menu
The key is defined as a Menu key. Pressing this key will cause a program-defined menu to appear on the screen.
Next
The cursor advances to the beginning of the next field. If the cursor is already in the last field, it moves to the end of the field unless this key has been assigned a TERMINATE or EXCEPTION value. In that case, the ACCEPT terminates.
Under windows, without TERMINATE and EXCEPTION value, if the cursor is in the last field, it moves to the first field, instead of moving to the end of the field.
Next-All
The cursor moves to the beginning of the next field regardless of whether or not the next field has a Tab-Stop. Thus a key with the "Next" action will skip controls with the NO-TAB style, while a key with the "Next-All" action will not.
By default, the Down key is assigned the Next-All action. This makes the Down key behave more like it does in a common Windows program. Assign the Down keyword (described above) for a more traditional, text-mode behavior.
Next-Line
Next-Line functions the same as the Down action, except that the cursor always moves to the beginning of the left-most field on the new line (instead of maintaining the current cursor column).
Numeric-Default
If the field is numeric, then this key acts just like the Default-Entry key. Typing this key at the first character position of a numeric field leaves the field unchanged and accepts the default value. Typing this key when the cursor is not in the first position causes erasure of the field from the cursor position to the end. This key allows the user either to accept the default or type over it without having to worry about blanking out the trailing portion of the field.
If the field is alphanumeric, then this action does not affect the field. Numeric-Default is usually made a termination key, so that typing it causes the ACCEPT to finish.
Numeric-Next
If the field is numeric, then this key acts just like the Default-Next key. Typing this key at the first character position of a numeric field leaves the field unchanged, accepts the default value, and advances to the beginning of the next field. Typing this key when the cursor is not in the first position causes erasure of the field from the cursor position to the end. The cursor is then advanced to the beginning of the next field. This key allows the user either to accept the default or type over it without having to worry about blanking out the trailing portion of the field.
If the field is alphanumeric, then this key acts just like the Next key. It advances the cursor to the beginning of the next field and does not affect the current field.
Page-Down
This keyword sets the key that pages down a multiline entry field, list box, and combo box.
Page-Up
This keyword sets the key that pages up a multiline entry field, list box, and combo box.
Previous
The cursor moves to the beginning of the previous field. If the cursor is in the first field, it moves to the beginning of the field unless the key has been assigned a TERMINATE or EXCEPTION value, in which case it acts as a termination key instead.
Previous-All
The cursor moves to the beginning of the previous field regardless of whether or not the previous field has a Tab-Stop. Thus a key with the "Previous" action will skip controls with the NO-TAB style, while a key with the "Previous-All" action will not.
By default, the Up key is assigned the Previous-All action. This makes the Up key behave more like it does in a common Windows program. Assign the Up keyword (described below) for a more traditional, text-mode behavior.
Under windows, without TERMINATE and EXCEPTION value, if the cursor is in the first field, it moves to the last field, instead of moving to the beginning of the field.
Previous-Line
The cursor moves to the beginning of the left-most field on the next higher line. If there are no fields above the current one, this action does nothing unless it has an EXCEPTION or TERMINATE value, in which case it acts as a termination key.
Right
This function moves the cursor one position to the right. This will not move the cursor onto any trailing prompt characters (exception: if the prompt character is a space and the field is being updated, the cursor will move over the trailing spaces). If the cursor is as far right as it is allowed to go, it will move to the beginning of the next field. If there is no following field, this key is ignored unless a TERMINATE or EXCEPTION value has been assigned, in which case the ACCEPT terminates.
Under windows, without TERMINATE and EXCEPTION value, if the cursor is as far right as it is allowed to go, the key is not ignored and moves to the first field.
Switch-Window
This keyword defines the key that, when pressed, causes the system to enter "switch window mode." In this mode, the user can press any key to cycle through the modeless windows, with each window border highlighted until the "Return" key is pressed. Window switching order is from top to bottom.
System-Menu
Use the System-Menu function to define the key used to activate a floating window's system menu on a text-mode system.
Toggle-Edit-Mode
This keyword defines the key that can be used to toggle the presence of the combo box's drop-down list and the paged list box's search box.
Toggle-Insert
If insertion mode is currently in effect, it is turned off. Otherwise, insertion mode is turned on.
Up
If there are fields above the current cursor location, the cursor moves to the one on the closest higher line. If there is more than one field on this line, the cursor moves to the field closest to its current location. The cursor will try to stay in its current column. If there are no lines above the current line with active fields, then this key is ignored unless it has a TERMINATE or EXCEPTION value, in which case it acts as a termination key.
4. EXCEPTION=value
The purpose of this keyword is to create an exception key. EXCEPTION assigns a decimal ASCII value to a key; the key becomes a termination key that also causes an exception condition. The assigned value is returned in the EXCEPTION clause or the CONTROL KEY clause of the ACCEPT statement. See the TERMINATE keyword below if you want to terminate input without causing an exception condition. Note that ACUCOBOL-GT inhibits exception keys when no EXCEPTION or CONTROL KEY clause is present in the ACCEPT statement, unless the program was compiled with the "-Vx" option.
5. HOT-KEY=value
ACUCOBOL-GT offers two methods for assigning hot keys-the KEYSTROKE keyword HOT-KEY described here, and the HOT-KEY runtime configuration variable described in Appendix H. Either or both may be used, but the results are undefined if you assign the same key using both formats. The total number of hot-key entries defined by both methods cannot exceed 16.
A hot key is a key that is associated with a program, so that when the key is pressed, the corresponding program is run. Value is the program name, which must be specified in single or double quotes if it is lowercase. The full configuration file entry looks like this:
KEYSTROKE HOT-KEY=program-name key-code
Pressing the key specified in key-code initiates execution of the program just as if it were named in a CALL statement. The key-code argument is one of the two-character key codes shown in the "Table of Keys," section 4.3.2.3.
For example, there is a screen printing sample program named PRNTSCRN provided with ACUCOBOL-GT. If you want to be able to initiate that program just by pressing the keyboard's "print" key, add the following line to your configuration file:
KEYSTROKE HOT-KEY=PRNTSCRN KP
Hot keys are active only during Format 1 and Format 2 ACCEPT statements (these are the forms of the ACCEPT verb that allow the user to enter data at the keyboard). When the user presses a hot key, the current program status is saved, and the program associated with the hot key is run. When the hot-key program exits (via the EXIT PROGRAM statement), control is returned to the program that was running when the hot key was pressed. The hot-key function does not save the original contents of the screen. You can accomplish this by popping up a window in your hot-key program, and then closing the window just before you exit the hot-key program.
A hot-key program is automatically passed two parameters. The first parameter is PIC X(200). It contains an image of the data in the field that was being entered at the time the hot key was pressed. The second parameter is a COMP-1 field that contains the length of the field being entered. You can define the first parameter as a table that depends on the second parameter like this:
LINKAGE SECTION.
01 CURRENT-FIELD.
03 OCCURS 1 TO 200 TIMES
DEPENDING ON FIELD-SIZE PIC X.
01 FIELD-SIZE PIC S9(4) COMP-1.
You are not required to declare or use either of these parameters in your hot-key program--they are provided for convenience.
The hot-key program may modify its first parameter. Any modifications made are reflected in the field that was being entered when the hot-key program was called. You might use this capability to perform a look-up function and then return the value found to the field being entered. If you want to pass additional data to the hot-key program, use EXTERNAL DATA ITEMS.
When a hot-key program is started, the value of the RETURN-CODE special register is saved and then set to zero. The hot-key program may alter this value. When the hot-key program exits, the value of RETURN-CODE is checked. The following table shows the possible values and the action that the calling program will take:
Value Action 0 continue ACCEPT
>0 generate exception if allowed
-1 activate "next field" logic
If the value of RETURN-CODE is zero, then the calling program continues to a normal completion of the ACCEPT statement that was active when the hot key was pressed.
If the value is greater than zero, then the calling program acts as if an exception key (with that value) was pressed. This will terminate the ACCEPT statement if it is of a format that allows exception keys.
If the value is "-1", then the ACCEPT statement will act as if a "next field" key were pressed by the user. This will cause the ACCEPT statement to proceed to the next field. If there are no more fields (or if there is only one field), then the ACCEPT statement will terminate with a termination value of zero. The hot-key program should not set RETURN-CODE to any negative value other than "-1". Other negative values are reserved for future use by ACUCOBOL-GT.
In any case, after the RETURN-CODE value established by the hot-key program has been acted upon by the calling program, RETURN-CODE is restored to the value it held before the hot-key program was called.
If a hot-key program cannot be executed, an error message is displayed to the user, and control returns to the ACCEPT statement.
Up to two hot-key programs per process may be active at once.
6. INVALID=value
If value is "Yes", the key is ignored when it is typed. This keyword may not be specified with any other keywords.
7. TERMINATE=value
This keyword is used to create a termination key. TERMINATE assigns a decimal ASCII value to a key; when the key is pressed, the ACCEPT is terminated and the assigned value is returned in the CONTROL KEY clause of the ACCEPT statement. TERMINATE does not cause the key to generate an exception condition when pressed; to define an exception key, use the EXCEPTION keyword instead.
4.3.2.3 Table of keys
The following table lists all of the keys that can be redefined. The table lists the key's full name, its two-character name (called the "key code"), and the corresponding key used on an MS-DOS keyboard. The key code is used in the terminal database file on UNIX and VAX/VMS systems to identify the corresponding key-sequence. For more information about user-defined keys, see Appendix M under Keyboard Differences.
Key Key Code MS-DOS Keyboard
(terminal db file)
Host's Backspace ZB BkSp
Host's Line-Kill ZK -
Cntrl-A - Cntrl-Z ^A - ^Z Ctl A-Z
Escape ^[ Esc
Control-\ ^\ Ctl-\
Control-] ^] Ctl-]
Control-^ ^^ Ctl-^
Control-_ ^_ Ctl-_
DEL 127 Ctl-BkSp
F1 - F10 k1 - k0 F1 - F10
F11 - F20 K1 - K0 Shft F1 - F10
Down Arrow kd Down
Home kh Home
Left Arrow kl Left
Right Arrow kr Right
Up Arrow ku Up
Insert Line kA Alt-I
Tab Left kB Shft-Tab
Clear-to-End kE Ctl-End
Delete Line kL Alt-K
Page Down kN PgDn
Page Up kP PgUp
Cancel Kc Alt-X
Next Paragraph Kd Ctl-Down
Word Left Kl Ctl-Left
Word Right Kr Ctl-Right
Previous Paragraph Ku Ctl-Up
Exit Kx Alt-E
Attention KA Alt-A
Bottom KB Ctl-PgDn
Clear KC Ctl-Home
Command (Do) KD Alt-D
End KE End
Find KF Alt-F
Insert Character KI Ins
Page Left KL Alt-L
Mark (Select) KM Alt-M
Print KP Alt-P
Page Right KR Alt-R
Send KS Alt-S
Top KT Ctl-PgUp
Save KV Alt-V
Delete Character KX Del
Help K? Alt-H
User-defined
key 1 - 10 U1 - U0 Alt F1 - F10
User-defined
key 11-20 A1 - A0 Alt-1 - Alt-0
The following keys may be used only on MS-DOS systems:
Key Key Code MS-DOS Keyboard
(terminal db file)
Control F1 - F10 C1 - C0 Ctl F1 - F10
Alt-Hyphen A- Alt--
Alt-Equals A= Alt-=
Alt-B AB Alt-B
Alt-C AC Alt-C
Alt-G AG Alt-G
Alt-J AJ Alt-J
Alt-N AN Alt-N
Alt-O AO Alt-O
Alt-Q AQ Alt-Q
Alt-T AT Alt-T
Alt-U AU Alt-U
Alt-W AW Alt-W
Alt-Y AY Alt-Y
Alt-Z AZ Alt-Z
The following table lists mouse-action "keys" that can be referenced by a KEYSTROKE entry; this table has meaning only for graphical systems such as Windows.
The table lists the mouse action, the corresponding key code, and the default exception value returned. See Book 2, Chapter 7, "Using the Mouse," for details on mouse handling.
Action Key Code Exception
Value
Mouse moved Mv 80
Left button pushed Ml 81
Left button released ML 82
Left button double-clicked M1 83
Middle button pushed Mm 84
Middle button released MM 85
Middle button double-clicked M2 86
Right button pushed Mr 87
Right button released MR 88
Right button double-clicked M3 89
The Host's Backspace and Line-Kill keys are not identified in the terminal database file. They are defined, instead, at the operating system level. The Backspace key is the key used to back up while you are typing command lines (usually either "backspace" or "delete"). The Line-Kill key is the one that is used to cancel an entire command line.
Control keys (Control plus another key) are not defined in the terminal database file. They are directly mapped by the runtime system to the corresponding control-key ASCII value. They can be referred to by either their ASCII value or by the key code listed. The DEL key does not have a key code; it can be referred to only by its ASCII value (127).
Some keys may have more than one name. When this occurs, the names have the following precedence:
1. Host name
2. Terminal database file name
3. Control-key name (if applicable)
For example, if a terminal whose left arrow key produces a Control-H is being used, and Control-H is the system's backspace key, that key would be treated as a Host's Backspace key (ZB). If the host's backspace were redefined (by operating system command) to be some other key, then this key would be considered a Left Arrow key (kl). It would be considered a Control-H (^H) only if the terminal database file were edited and the "kl" definition changed or removed.
4.3.2.4 Special keys:
The following keys deserve special attention.
Arrow keys
The left and right arrow keys can be configured to meet a variety of needs.
a. As exception keys only. In this case, typing an arrow key will cause an ACCEPT to terminate immediately with the arrow-key exception value. The program can then take the appropriate action (such as moving a highlight in the requested direction). To configure an arrow in this manner, define an EXCEPTION value for it with the KEYSTROKE runtime configuration variable.
b. As edit keys only. In this case, the arrows will move the cursor within the ACCEPT field, but will not move outside the boundaries of the field. In this mode, the arrow key will never terminate the ACCEPT. To configure an arrow in this manner, define the appropriate EDIT value for it with the KEYSTROKE runtime configuration variable.
c. As both exception keys and edit keys. In this mode, the arrows will act as edit keys within the ACCEPT field, but will act as exception keys when the user tries to move outside the field. This can be useful if you are writing a "fill-in-the-form" style of application. To configure an arrow in this manner, define both an EXCEPTION and an EDIT value for it.
By default, the left and right arrows act as edit keys, and the up and down arrows act as both edit and exception keys. You can change the behavior of the arrows at runtime to switch between different modes if you need to. You do this via the SET ENVIRONMENT verb and the appropriate KEYSTROKE settings. For example, to configure the left arrow to act as an editing key from within a program, use:
SET ENVIRONMENT "KEYSTROKE" TO "EDIT=Left kl"
Backspace vs. Left Arrow
On some terminals, the Backspace and Left Arrow keys send the same hardware signal. If so, ACUCOBOL-GT's key naming rules will treat both as a (destructive) Backspace, because the host name takes precedence. You can deal with this situation in one of several ways; some possibilities are:
1. If you do not use the Left Arrow key as anything other than an edit key, you can probably just use the defaults. You will not have the Left Arrow capability, but most users prefer to have destructive Backspace instead. Alternatively, if you prefer to have Left Arrow instead of destructive Backspace you can, with a KEYSTROKE variable, define the Backspace key to have the "Left" edit action.
2. If you use the Left Arrow as an exception key, then you can leave the destructive backspace action on the Backspace key and also give it an exception code value. This will cause the Backspace key to act as a destructive backspace while the cursor is in an ACCEPT field. The Left Arrow exception value will be returned when the user backspaces off the left edge of the field.
3. Finally, you can use operating system commands to assign the host's Backspace key to another key. This will then cause the Backspace key to be recognized as a Left Arrow key while the other key will take on the characteristics of the Backspace key. If you wish to do this, a common key to use as the alternate Backspace key is the Rub Out (or DEL) key.
Other combinations exist, but this should give you a general idea of ways to address this issue.
Interrupt key
ACUCOBOL-GT has no way of defining a key to be the asynchronous interrupt key. ACUCOBOL-GT makes use of the host's definition for this key. This has two effects:
1. If you want to define a special asynchronous interrupt key, you must do so at the operating system level. Note that MS-DOS does not allow you to redefine the Interrupt key (it is always Control-C).
2. Whichever key is used as the Interrupt key will be unavailable to you as a normal key. This is because the host operating system acts on this key prior to ACUCOBOL-GT's ever receiving it. ACUCOBOL-GT "sees" an interrupt when this key is typed; it never receives a character for it.
4.3.2.5 Default keyboard
The default ACUCOBOL-GT keyboard is defined below in the language of the KEYBOARD and KEYSTROKE runtime configuration variables.
KEYBOARD Data-range=32,255
KEYBOARD Exception-range=1,31
KEYBOARD Auto-Return=0 Screen-Default=No
KEYBOARD RM-2-Default-Handling=No
KEYBOARD Check-Numbers=Yes
KEYBOARD Cursor-Past-End=No
KEYSTROKE Terminate=13 ^M
KEYSTROKE Edit=Next Terminate=9 ^I
KEYSTROKE Edit=Previous kB
KEYSTROKE Edit=Backspace ZB
KEYSTROKE Edit=Erase-Field ZK
KEYSTROKE Edit=First kh
KEYSTROKE Edit=Last KE
KEYSTROKE Edit=Auto-Insert KI
KEYSTROKE Edit=Delete KX
KEYSTROKE Edit=Erase-Field KC
KEYSTROKE Edit=Erase-to-End kE
KEYSTROKE Edit=Left kl
KEYSTROKE Edit=Right kr
KEYSTROKE Edit=Up Exception=52 ku
KEYSTROKE Edit=Down Exception=53 kd
KEYSTROKE Exception=67 kP
KEYSTROKE Exception=68 kN
KEYSTROKE Exception=40 KD
KEYSTROKE Exception=90 K?
KEYSTROKE Exception=1 k1
KEYSTROKE Exception=2 k2
KEYSTROKE Exception=3 k3
KEYSTROKE Exception=4 k4
KEYSTROKE Exception=5 k5
KEYSTROKE Exception=6 k6
KEYSTROKE Exception=7 k7
KEYSTROKE Exception=8 k8
KEYSTROKE Exception=9 k9
KEYSTROKE Exception=10 k0
KEYSTROKE Exception=11 K1
KEYSTROKE Exception=12 K2
KEYSTROKE Exception=13 K3
KEYSTROKE Exception=14 K4
KEYSTROKE Exception=15 K5
KEYSTROKE Exception=16 K6
KEYSTROKE Exception=17 K7
KEYSTROKE Exception=18 K8
KEYSTROKE Exception=19 K9
KEYSTROKE Exception=20 K0
4.3.2.6 Modification examples
Following are examples of some common modifications to the default keyboard settings.
In the default keyboard, the "Tab" key is used to move from one field to the next. The "Return" key is used to terminate the ACCEPT. If you want the "Return" key to move the user to the next field instead of immediately terminating the ACCEPT, the following entry in the runtime configuration file will cause that to happen:
KEYSTROKE EDIT=Next TERMINATE=13 ^M
Alternately, you might want the "Return" key to clear the part of the field that follows the cursor. If you want to do this along with the previous modification, you can use either of these entries:
KEYSTROKE EDIT=Erase-Next TERMINATE=13 ^M
KEYSTROKE EDIT=Default-Next TERMINATE=13 ^M
These two lines have slightly different methods of handling how the field is cleared. The first version always erases the field from the current cursor location to the end. The second form does this only if the cursor is not in the home position of the field. You can also use the actions "Erase-to-End" or "Default-Entry" if you do not want the "Return" key to act as a "next field" key.