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.