Arrow Keys

The left and right arrow keys can be configured to meet a variety of needs.

  1. 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.
  2. 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.
  3. 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 run time 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"