Keyboard Configuration

Each terminal has several keys that are available to be used for special purposes. Some of these keys are used as field termination keys, others are used as editing keys. ACUCOBOL-GT supports a large number of special keys, but in the default configuration, only these are used:

Function Keys 1-20     Help
Arrow Keys Do
Page Up Page Down
Backspace Line-Kill
Home End
Insert Delete
Clear Clear to End
Carriage Return Control Keys

The Backspace and Line-Kill keys are whichever keys provide these functions for your operating system. The Backspace key is the one that erases individual characters from a command line; the Line-Kill key is the one that can cancel a command line. On most systems, the key that performs the Backspace function is the one labeled either backspace or delete.

The keyboard interface can be easily configured to meet a variety of needs. The default configuration has the following characteristics:

  1. The range of legal input characters is ASCII values 32 through 255. Other characters outside this range are ignored unless covered by one of the cases below.
  2. The range of exception characters is ASCII values 1 through 31. If any of these characters is typed, an exception condition exists and input to the field is terminated. The exception key value is identical to the ASCII value of the key. For example, if Control-E is typed, then the exception key value returned would be 5. This rule does not apply to characters specifically listed in rule 3.
  3. The following table outlines the actions of other keys. In this table, Action is the special action performed by the key. If a number is present here, then this key terminates the field and returns that number as its termination key value. If the number is starred (*), then this key also causes an exception condition. If there are both a number and an action, then the key acts as a termination key when the action cannot be applied.

    The Windows column names the keycap on the IBM-PC keyboard that is used for this key. The Termcap column names the terminal database file entry that corresponds to this key for UNIX and VMS systems.

Key Action Windows Termcap
Carriage Return 13 Enter  
Tab Next Field (9) Tab  
Host's Backspace     Backspace BkSp  
Host's Line-Kill Erase Field    
Backtab Previous Field Shft-Tab kB
Home First Field Home kh
End Last Field End KE
Insert Auto-Insert Mode Ins KI
Delete Delete Character Del KX
Clear Erase Field Ctl-Home KC
Clear-to-End Erase Remainder     Ctl-End kE
Left Arrow Left Left kl
Right Arrow Right Right kr
Up Arrow Previous-All (52*) Up ku
Down Arrow Next-All (53*) Down kd
Page Up Page-Up (67*) PgUp kP
Page Down Page-Down (68*) PgDn kN
Do (Command) 40*   KD
Help 90*   K?
F1 - F10 1 - 10* F1 - F10 k1 - k0
F11 - F20 11 - 20* Shft F1 - F10     K1 - K0    
Note: Keys that terminate input with an exception condition are ignored by ACUCOBOL-GT if the ACCEPT statement does not have an EXCEPTION clause or a CONTROL KEY clause. However, if you use the -Vx compile-time option, exception keys will be recognized even if the ACCEPT statement does not contain an EXCEPTION or CONTROL KEY clause.

When accepting data from the keyboard, the Terminal Manager runs in one of two modes: standard mode or auto mode. In standard mode, the only way to finish input is by typing one of the allowed termination keys; the cursor may not leave the field. In auto mode, the cursor can leave the field; when the user fills the field with data, it is immediately accepted and the cursor moves on. The setting of auto mode or standard mode is determined by the various clauses specified on the ACCEPT statement.

There are four methods for accepting a field (ACCEPT verb, Format 1), depending on the mode and the presence of either the CONTROL KEY clause or the ON EXCEPTION clause. These methods are:

The Terminal Manager can control more than one field when the program is doing an ACCEPT that refers to a Screen Section item (ACCEPT verb, Format 2). In the course of this ACCEPT, the user can move between the fields by using the Tab, Backtab, Left, Right, Up, Down, Home and End keys; the Tab key acts as a terminate key only in the last field. A Format 2 ACCEPT statement does not support the use of the CONTROL KEY clause; the CRT STATUS phrase of the Special-Names paragraph may be substituted. Data entry for a Screen otherwise falls into four categories much like the above.

The termination and exception keys may be changed by runtime configuration options as described in Redefining the Keyboard.