Sun Microsystems 800-1256-04 — Sun Microsystems 800-1256-04 SunCGI Reference Manual PDF (EN)

84 SunCGI Reference Manual 0 RELEASED Initialize LID Release LID NO EVENTS timeout or trigger fire Disable Events or trigger fire Request Input Initiate Request Enable Events Disable Events RESPOND EVENT REQUEST EVENT QUEUE EVENT 0 Figure 5-1 CG! Input State Model 5.1. Input Device Initialization Before input can be processed, an input devices must be initialized and associ- ated with a trigger. Input device initialization requires at least one active view surface. Typically, the procedure for initializing an input device includes calls to the initialize_ lid and associate functions which tum on an input dev- ice and associate it with a specific trigger.

Initialize LID Cerror initialize_lid(devclass, devnum, ival) Cdevoff devclass; /* device type*/ Cint devnum; /* device number*/ Cinrep *ival; /* initial value of device measure*/ initialize_lid initializes an input device and changes its state from RELEASED to NO_ EVENTS. 1bis function must be called for an input device before it can be referenced by any other input fullCl:ion. The argument devclass specifies the desired type of input value. devnum indicates the number of the device within that class. The argument ival sets the initial measure of the dev- ice. Toe Cinrep structure contains different elements for each type of measure.

Toe i appropriate element of Cinrep must be set or an error will be generated. o I Version C of 17 March 1986