Page 53 Table of Contents Index Page 55
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E





Chapter 8

Sheet Protocols

8.1 Input Protocol

CLIM's windowing substrate provides an input architecture and standard functionality for no-
tifying clients of input that is distributed to their sheets. Input includes such events as the
pointer entering and exiting sheets, pointer motion (whose granularity is defined by performance
limitations), and pointer button and keyboard events. At this level, input is represented as event
objects.

Sheets either participate fully in the input protocol or are mute for input. If any functions in
the input protocol are called on a sheet that is mute for input, the sheet-is-mute-for-input
error will be signalled.

In addition to handling input event, a sheet is also responsible for providing other input services,
such as controlling the pointer's appearance, and polling for current pointer and keyboard state.

Input is processed on a per-port basis by the function process-next-event. In multiprocessing
environments, a process that calls process-next-event in a loop is created for each port. In
single-process Lisps, process-next-event is called whenever the user would go blocked for
input.

process-next-event has three main tasks when it receives an event. First, it must determine
to which client the event is addressed; this process is called distributing. Typically, the client
is a sheet, but there are other special-purpose clients to which events can also be dispatched.
Next, process-next-event formats the event into a standard format, and finally it dispatches
the event to the client. A client may then either handle the event synchronously, or it may queue
it for later handling by another process.

Input events can be broadly categorized into pointer events and keyboard events. By default,
pointer events are dispatched to the lowest sheet in the hierarchy whose region contains the
location of the pointer. Keyboard events are dispatched to the port's keyboard input focus; the


Page 53 Table of Contents Index Page 55
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E