Next: , Previous: , Up: Events and Input   [Contents][Index]


13.3 Managing the Event Queue

The following paragraphs describe CLX functions and macros used to:

Function: queue-event display event-key &rest event-slots &key :append-p &allow-other-keys
display

A display.

event-key

Specifies the type of event placed in the queue.

event-slots

Keyword-value pairs that describe the contents of an event.

:append-p

If true, the event is placed at the tail of the queue; otherwise, the event is placed at the head of the queue.

Places an event of the type given by event-key into the event queue. When :append-p is true, the event is placed at the tail of the queue; otherwise, the event is placed at the head of the queue. The actual event-slots passed depend on the event type. The keyword symbols used for each event type are event slot names defined by the declare-event macro and are described in Declaring Event Types.

Function: discard-current-event display
display

A display.

Discards the current event for the display. Returns nil when the event queue is empty; otherwise, returns t. This function provides extra flexibility for discarding events, but it should be used carefully; use event-cond instead, if possible. Typically, discard-current-event is called inside a handler function or a clause of an event-case form and is followed by another call to process-event, event-case, or event-cond.

discarded-p

Type boolean.

Function: event-listen display &optional (timeout 0)
display

A display.

timeout

The number of seconds to wait for events.

Returns the number of events queued locally. If the event queue is empty, event-listen waits for an event to arrive. If timeout is non-nil and no event arrives within the specified timeout interval (given in seconds), event-listen returns nil; if timeout is nil, event-listen will not return until an event arrives.

event-count

Type (or null integer).

Macro: with-event-queue display &body body
display

A display.

body

Forms to execute.

Executes the body in a critical region in which the executing client process has exclusive access to the event queue.


Next: , Previous: , Up: Events and Input   [Contents][Index]