The Keyboard Interface

The Vermont Views keyboard interface includes standard systems for naming keys, navigating forms and windows, and using mnemonic selection keys.

Standard Key Names

To increase portability of code, Vermont Views uses a system of standard key names. The keycodes returned by any particular physical key have been standardized for all keyboards. This means that in the Vermont Views system, pressing F1 always returns a KEY_F1, whether the user is using a IBM PC keyboard, IBM Extended Keyboard, or a keyboard attached to a terminal running in the UNIX or VMS environment. This system allows Vermont Views to simulate function keys that may not exist on some terminals. For example, Vermont Views allows a user on a VT100, which has only four function keys, to simulate the F5 key by pressing Esc and then 5. This key sequence is translated to KEY_F5. In your application, the process is completely transparent; you do not need to be concerned with whether the user pressed F5 on an IBM PC or Esc 5 on a VT100. These standard key names are #defined in the vv_key.h header file.

For terminal-based systems, a keystroke sequence and how it is translated into a keycode is determined by a command string in the vvtermcap entry for the terminal. Vermont Views provides default keystroke sequences for all the keycodes used in interactive Vermont Views processes. To learn more about the terminal interface, see Chapters 57 and 58, "Operating Under UNIX, POSIX, VMS, and XENIX" and "Modifying the Terminal Interface."

Standard Navigational Keys

Vermont Views automatically provides a consistent system of key usage for navigating forms and windows. You do not need to do anything to enable this system; it is the default. When a navigational key is pressed, Vermont Views reads the key, moves the cursor appropriately, and highlights the selected item.

Some of the most commonly used navigational keys are listed in Table 3.1.

Table 3.1: Standard Navigational Keys

Action Key (PCDOS, OS/2) Keycode
Next field Tab KEY_TAB
Previous field Shift-Tab KEY_STAB
Previous item on the form F7 KEY_F7
Next item on the form F8 KEY_F8
First item on the form Ctrl-Home KEY_CHOME
Last item on the form Ctrl-End KEY_CEND
Quit (escape) current process Esc KEY_ESC
Exit current process F10 KEY_F10
Previous form (if forms are linked) Shift-F7 KEY_SF7
Next form (if forms are linked) Shift-F8 KEY_SF8

Vermont Views provides additional keys for most objects, allowing cursor movement specific for that object or item. For example, PgUp and PgDn move the data in a scrollable region one page up and one page down, respectively. Object-specific keys are discussed in the sections that describe the objects.

A listing of Vermont Views keys and associated actions can be found in the event tables listed in the header file vv_glob.h or in the "Event Tables" section of the Function Reference.

Common User Access (CUA) Navigational Keys

Vermont Views provides an alternative to its standard system of navigation. You can disable the Vermont Views keyboard interface and enable a keyboard interface that follows the guidelines set by IBM Systems Application Architecture Common User Access (CUA) standards. To disable the standard Vermont Views keyboard interface and enable the CUA keyboard interface, simply #include the header file vv_cua.h before vv_main.h in your main program.

Some of the most commonly used CUA navigational keys are listed in Table 3.2.

Table 3.2: CUA Navigational Keys

Action Key (PCDOS, OS/2) Keycode
Next field Tab KEY_TAB
Previous field Shift-Tab KEY_STAB
Quit (escape) current process Esc KEY_ESC
Exit current process Enter KEY_ENTER
Access the system menu F10 KEY_F10

A complete listing of CUA keys and associated actions can be found in the event tables listed in the header file vv_glob.h.

Field Selection Keys

Vermont Views supports navigation using field selection keys. A field selection key is a single designated character associated with a field. When the user types the selection character for a field, that field is immediately selected. Vermont Views allows you to specify a special display attribute for the selection character to provide a visual cue for users.

You add character selection to your application by setting special form and field options. To learn how to use these features see the following chapters: Chapter 16 "Data Form Processing Options," Chapter 12 "Choice Lists," and Chapter 22 "Using Menu Options and Features."


Home Contents Previous Next