ev_getdev(S) 6 January 1993 ev_getdev(S) Name ev_getdev - gets a list of devices feeding an event queue Syntax cc . . . -levent #include <sys/types.h> #include <sys/param.h> #include <sys/sysmacros.h> #include <sys/page.h> #include <sys/event.h> #include <mouse.h> struct devinfo * ev_getdev (dev_mask, devinfop) dmask_t dev_mask; struct devinfo *devinfop; Description evgetdev allows a program to examine the devices that are attached to its event queue. An open event queue must have been previously obtained with evinit and evopen. This routine takes two arguments, a bitmask of device classes and a pointer to a deviceinfo structure. The device mask indicates the classes of devices in which the program is interested. The device pointer is used to cycle through the devices attached to the queue. The device mask is made by OR'ing together a subset of DREL, DABS, DSTRING1 and DOTHER. These values represent classes of graphics input devices. DREL refers to relative locator devices like mice. DABS refers to absolute locator devices like bitpads and lightpens. DSTRING refers to character stream devices like the keyboard. The device pointer parameter is NULL for the first call. Each call returns a pointer which should be passed in in subsequent calls. When the routine has iterated through all the devices attached to the queue, it returns NULL. The device information pointer points to a structure which looks like this: struct devinfo { short handle; /* not used by application */ short class; /* REL, ABS, STRING or OTHER */ short type; /* The type of hardware */ char *name; /* Device name, from data files */ char *key; /* Device key, from data files */ short buttons; }; An application can examine this information and decide whether or not to use the device. The evgindev routine allows a program to exclude or later re-include a device. The pointer returned by evgetdev is passed in to evgindev. When a queue is opened, a bitmask specifying what kinds of devices to attach is supplied. All devices of a class which is masked in are attached to the queue. This routine is used to examine those devices. Diagnostics This routine returns -1 to a program which does not have an open event queue. It returns -2 if no devices of any class which is masked in are found. Normally it returns zero. See also evblock(S), evclose(S), evcount(S), evflush(S), evgetemask(S), evgindev(S), evinit(S), evopen(S), evpop(S), evread(S), evresume(S), evsetemask(S), evsuspend(S) Notes The keyboard is attached to an event queue whenever devices of class DSTRING are requested. If the keyboard is attached to an event queue, then the keyboard does not generate normal stdin input until the event queue is closed. Standards conformance evgetdev is not part of any currently supported standard; it is an extension of AT&T System V provided by the Santa Cruz Operation.