A data structure that provides information about the state of the system and the most recent event.
The Event data structure provides information about the most recent event and about the state of the system when that event occurred.
The components of the Event data structure are set when an event occurs in the user interface. An application program can use the information in the fields to determine what action, if any, to take.
The fields in the Event structure are
AltKey, CtrlKey, EventName, EventTag, EventType, FieldTag, FormTag, KeyPressed , MenuItemTag, MenuTag, MouseClick , ScrollingKey, ShiftKey, WindowTag
Provides information about the state of the Alt, Ctrl, or Shift key during the last event
event.altkey
event.ctrlkey
event.shiftkey
Character string (binary). Can be reset by the application program.
The variables provide information about the state of the Alt, Ctrl, and Shift keys during the last event.
The string is set to '1' ($True) if the indicated key was down when the last event occurred. Otherwise, it is set to '0' ($False).
event.eventname
Where eventname is one of
Character string (alpha). Can be reset by the application program.
The Event data structure provides information about the most recent event and about the state of the system when that event occurred.
The components of the Event data structure are set when an event occurs in the user interface. An application program can use the information in the fields to determine what action, if any, to take.
event.eventtag
Character string (ALPHA). Can be reset by the application program.
The variable identifies, by its tag, the object in which the last user interface event occurred. The variable can be
| EventType Setting | EventTag Value Taken From |
| Window | Event.WindowTag |
| Menu | Event.MenuTag |
| Menuitem | Event.MenuItemTag |
| Form | Event.FormTag |
| Formfield | Event.FieldTag |
| Accelerator | Event.FieldTag |
| System | Event.FieldTag |
event.eventtype
Character string (ALPHA). Can be reset by the application program.
The variable identifies the type of user interface event that last occurred.
event.fieldtag
Character string (ALPHA). Can be reset by the application program.
The variable identifies, by its tag, the current field at the time of the last event.
event.formtag
Character string (ALPHA). Can be reset by the application program.
The variable, identifies, by its tag, the current form at the time of the last event.
event.keypressed
Character string (CHAR). Can be reset by the application program.
The variable indicates, by name, the pressed key that caused the last event to occur.
Note: The keynames associated with accelerator events, such as F1, are recorded in EventName.
If the user presses the a key in a form field and a Modified event is intercepted by the application program, then Event.KeyPressed is set to a.
event.menuitemtag
Character string (ALPHA). Can be reset by the application program.
The variable identifies, by its tag, the selected item on the menu in the current window at the time of the last event.
event.menutag
Character string (ALPHA). Can be reset by the application program.
The variable identifies, by its tag, the current menu at the time of the last event.
event.mouseclick
Character string (binary). Can be reset by the application program.
The variable indicates if a mouse button acceleration caused an event to occur.
It is set to '1' ($True) if the event was caused by pressing a mouse button that is defined as an accelerator for the window. Otherwise, it is set to '0' ($False).
event.scrollingkey
Character string (ALPHA). Can be reset by the application program.
The variable indicates if an event corresponds to a defined SCROLL key.
It is set to '1' ($True) if an event corresponds to an accelerator key that is also a defined SCROLL key for the window. Otherwise, it is set to '0' ($False).
Accelerators and SCROLL keys are defined using WINDOW SET commands.
The application fragment that follows enables employee records to be scrolled through a form and the data to be updated. The combined actions are accomplished by defining certain keys both as accelerators and SCROLL keys. When one of these keys is pressed, the corresponding accelerator event occurs. The application program uses ScrollingKey to detect that a SCROLL key was pressed and performs the scrolling action after saving the updated data.
window set scroll Up F7 Down F8
window set accelerator F7 F8 escape
form open fEmployee
form set scroll fEmployee from EmpSet
form display
while
form input
if event.scrollingkey = $true
if thisform.formchanged = $true
change EmpSet from fEmployee
endif
form scroll
continue
endif
... other commands ...
endwhile
event.windowtag
Character string (ALPHA). Can be reset by the application program.
The variable identifies, by its tag, the current window at the time of the last event.