Appendix E
© 1995, 1996, 1997 Gregg M. Townsend, Ralph E. Griswold, and Clinton
L. Jeffery
Event Queues
Each window has an event queue, which is an ordinary Icon list. Pending()
produces an event queue. An event is represented by three consecutive values
on the list. The first value is the event code: a string for a keypress
event or an integer for any other event. The next two values are Icon integers
whose lower-order 31 bits are interpreted as fields having this format:
000 0000 0000 0SMC XXXX XXXX XXXX XXXX (second value)
EEE MMMM MMMM MMMM YYYY YYYY YYYY YYYY (third value)
The fields have these meanings:
X...X &x
: 16-bit signed x-coordinate value
Y...Y &y:
16-bit signed y-coordinate value
SMC &shift, &meta, and &control flags
E...M &interval, interpreted as M^16E milliseconds
0 unused; should be zero
Coordinate values do not reflect any translation specified by dx
and dy
attributes; the translation is applied by Event()
when an event is read.
A malformed event queue error is reported if an error is detected when trying
to read the event queue. Possible causes for the error include an event
queue containing fewer than three values, or second or third entries that
are not integer values or that are out of range. Only artificially constructed
events can produce such errors.
Back to Contents