Next: Toolkits and Callbacks
Up: Basic User Interface
Previous: Polling and Sampling
- Device is monitored by an asynchronous process.
- Upon change in status of device, this process places a record into an
event queue.
- Application can request read-out of queue:
- Number of events
- 1st waiting event
- Highest priority event
- 1st event of some category
- All events
- Application can also
- Specify which events should be placed in queue
- Clear and reset the queue
- Etc.
- Queue reading may be blocking or non-blocking
- Processing may be through callbacks
- Events may be processed interruptively
- Events can be associated with more than devices
Without interrupts, the application will engage in
an event loop
- not a tight loop
- a preliminary of register event actions
followed by a repetition of test for event actions.
For more sophisticated queue management,
- The cursor is usually bound to a pair of valuators,
typically MOUSE_X and MOUSE_Y.
- Events can be restricted to particular areas of the screen,
based on the cursor position.
- Events can be very general or specific:
- A mouse button or keyboard key is depressed.
- A mouse button or keyboard key is released.
- The cursor enters a window.
- The cursor has moved more than a certain amount.
- An Expose event is triggered under X when
a window becomes visible.
- A Configure event is triggered when a
window is resized.
- A timer event may occur after a certain interval.
- Simple event queues just record a code for event (Iris GL).
- Better event queues record extra information such as
time stamps
(X windows).
Next: Toolkits and Callbacks
Up: Basic User Interface
Previous: Polling and Sampling
CS488/688: Introduction to Interactive Computer Graphics
University of Waterloo
Computer Graphics Lab
cs488@cgl.uwaterloo.ca