A more meaningful and intuitive stream of events is provided by using synthetic events. Synthetic events [Cardelli, 85] are logical events which occur as the result of a specific sequence of real or physical events. For example, a leftButtonClick: event occurs whenever a leltButtonDown:, leftButtonUp: event sequence occurs within a given time frame. Further, using the state of the user interface, more complex event synthesis can be done. The leftButtonClickln: is generated when a leftButtonClick: event (a synthetic event) occurs inside a view (see Figure 4.1).
Sophisticated event management and synthesis improves the simplicity and modularity of the view code.
In addition to the events generated by user interaction and the event manager, the application can create and post events (software events). Software events have higher priority than normal events. This allows applications to synthesize events and still maintain proper temporal ordering. Suppose four leftButtonClick: events were generated in a particular view and the related application dictates that three consecutive button clicks defines some event, x:. When the application receives the first three events it will create and post a x: event. This new event should be processed before the fourth button click since it happened before the click. Although not necessary, a sophisticated event manager can have an event priority scheme to attach levels of importance to particular events and thus particular input sources.