An event table consists of a list of event codes; each event code is associated with a C language function (an event function).
An event table is an array of event table structures of type ET. The first member in the structure is an event code value and the second member is a pointer to the function associated with that event code. As an example, the viewing event table used for browsing a virtual window is reproduced below:
|
Note that the event function kv_lft() is assigned to KEY_LEFT, kv_rt() assigned to KEY_RIGHT, etc. ET_DEFAULT, is used to indicate the default event function for the event table. The default event function is called if the event code being processed is not found in the event table. Two empty entries are found in this event table and can be used to install additional event code-event function pairs. (You can add additional empty entries. See Chapter 39, "Installing Event Functions and Modifying Event Tables," for more information.) ET_END is the end-of-table marker.
Default event tables are provided for all interactive tasks in Vermont Views. They are defined in the header file vv_glob.h and are listed in Table 37.1. A complete listing of all key assignments for each event table can be found in the Function Reference.
Table 37.1: System-Defined Event Tables
| Event Table | System |
| CLETP | Choice list processing (data-entry and standalone) |
| DRAGETP | Interactive dragging of a window (used by wn_drag()) |
| FLDETP | Data field processing |
| FMETP | Data form processing |
| HELPETP | Viewing the help system |
| LBOXETP | Processing list boxes |
| MEMOETP | Editing memo fields |
| MNETP | Menu field processing |
| PUSHETP | Pushbutton field processing |
| RADIOETP | Radio button field processing |
| SRETP | Scrollable region processing |
| SYSETP | System event table (searched during all system processing |
| TTMEMOETP | Editing tickertape memo fields |
| VIEWETP | Browsing (used by wn_browse() and mf_browse()) |