Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!uunet!cbmvax!ag From: ag@cbmvax.commodore.com (Keith Gabryelski) Newsgroups: comp.windows.x Subject: Simple X11R4 Server question. Message-ID: <16366@cbmvax.commodore.com> Date: 7 Dec 90 16:37:56 GMT Reply-To: ag@cbmvax.commodore.com (Keith Gabryelski) Organization: Commodore-Amiga Unix; West Chester, PA Lines: 28 I have brought up a monochrome X server under Amiga Unix (System V Release 4.0). I am wondering how a server function [ProcessInputEvents()] is suppose to register that it wants to be called when the file descriptor it has open for the mouse and keyboard (one descriptor for both) is ready for reading. WaitFor.c looks something like: i = select(MAXSOCKS, (int *)LastSelectMask, NULL, NULL, wt); selecterr = errno; WakeupHandler((unsigned long)i, (pointer)LastSelectMask); The Wakeuphandler gets called with the number of fd ready and which fds are ready. So, in my WakeupHandler() I check FD_ISSET(myfd, LastSelectMask) to see if myfd (the file descriptor for the keyboard/mouse device) has input ready and if FD_ISSET() returns TRUE I call ProcesssInputEvents(). This works. Is there a better way? I would think there is a way to bind a file descriptor to a function so the WaitFor loop would automatically call ProcessInputEvents() when myfd returned ready from select(). Pax, Keith